1
0
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:
Pavol Rusnak 2016-05-23 16:05:52 +02:00
parent 2576d9c3a4
commit af9d2cf21f
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -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)
'''