add mock for trezor.config

pull/25/head
Pavol Rusnak 8 years ago
parent 2576d9c3a4
commit af9d2cf21f
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -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…
Cancel
Save