mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 05:28:40 +00:00
add mock for trezor.config
This commit is contained in:
parent
2576d9c3a4
commit
af9d2cf21f
@ -1,3 +1,17 @@
|
||||
# mock in-memory implementation
|
||||
|
||||
_mock = {}
|
||||
|
||||
def get(app, key, default=None):
|
||||
return _mock.get((app << 8) | key, default)
|
||||
|
||||
def set(app, key, value):
|
||||
_mock[(app << 8) | key] = value
|
||||
return True
|
||||
|
||||
# real implementation commented below
|
||||
|
||||
'''
|
||||
from TrezorConfig import Config
|
||||
|
||||
_config = Config()
|
||||
@ -8,3 +22,4 @@ def get(app, key, default=None):
|
||||
|
||||
def set(app, key, value):
|
||||
return _config.set(app, key, value)
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user