feat(core): add auto_lock_delay and display_rotation to Features

pull/1291/head
Martin Milata 4 years ago committed by Tomas Susanka
parent b2c4bbdaa2
commit 542f32d3b1

@ -93,6 +93,8 @@ def get_features() -> Features:
f.wipe_code_protection = config.has_wipe_code()
f.passphrase_always_on_device = storage.device.get_passphrase_always_on_device()
f.safety_checks = safety_checks.read_setting()
f.auto_lock_delay_ms = storage.device.get_autolock_delay_ms()
f.display_rotation = storage.device.get_rotation()
return f

@ -79,6 +79,16 @@ def test_apply_auto_lock_delay(client):
)
def test_apply_auto_lock_delay_valid(client, seconds):
set_autolock_delay(client, seconds * 1000)
assert client.features.auto_lock_delay_ms == seconds * 1000
def test_autolock_default_value(client):
assert client.features.auto_lock_delay_ms is None
with client:
client.use_pin_sequence([PIN4])
device.apply_settings(client, label="pls unlock")
client.refresh_features()
assert client.features.auto_lock_delay_ms == 60 * 10 * 1000
@pytest.mark.skip_ui

@ -49,6 +49,16 @@ class TestMsgApplysettings:
assert client.features.label == "new label"
@pytest.mark.skip_t1
def test_apply_settings_rotation(self, client):
assert client.features.display_rotation is None
with client:
_set_expected_responses(client)
device.apply_settings(client, display_rotation=270)
assert client.features.display_rotation == 270
@pytest.mark.skip_t2
def test_invalid_language(self, client):
assert client.features.language == "en-US"

@ -46,6 +46,7 @@
"test_autolock.py::test_apply_auto_lock_delay_valid[60]": "02f813f809bec7b303998fe288f02bfa4cd1a30990c0dc071ad51ff86f2739e6",
"test_autolock.py::test_apply_auto_lock_delay_valid[7227]": "41bca947f7834baa9968cbb164b70005aee4dbf23586187ab3bef336ff42a422",
"test_autolock.py::test_autolock_cancels_ui": "eedc6196565bf6d53bc9c3f8984acc2bb91d2d71e57f3a28f8afbe35b02fb4dc",
"test_autolock.py::test_autolock_default_value": "4e564ee7f060684b4a0e8c7439fc867dc221f59c35b68f84d7a641d9e466d3e6",
"test_basic.py-test_device_id_different": "bc6acd0386b9d009e6550519917d6e08632b3badde0b0cf04c95abe5f773038a",
"test_basic.py-test_device_id_same": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_basic.py-test_features": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
@ -54,6 +55,7 @@
"test_msg_applysettings.py-test_apply_settings": "2cc8bf660f3be815d19a4bf1265936162a58386fbe632ca4be01541245b79134",
"test_msg_applysettings.py-test_apply_settings_passphrase": "5c1ed9a0be3d14475102d447da0b5d51bbb6dfaaeceff5ea9179064609db7870",
"test_msg_applysettings.py-test_apply_settings_passphrase_on_device": "3e6527e227bdde54f51bc9c417b176d0d87fdb6c40c4761368f50eb201b4beed",
"test_msg_applysettings.py-test_apply_settings_rotation": "e4a544dfc55550e340a3879d23ffab7b8ccc6362060ec941c3a7d545675d3cbd",
"test_msg_applysettings.py-test_safety_checks": "4eb00e8d3bce08e800f3524f9a03960865c9725a08df0ebe57853602cd84b6a5",
"test_msg_authorize_coinjoin.py::test_cancel_authorization": "d8a608beb6165f5667cc44dcff6bdc17ebb4638ddd3bd09e7f0e1e75d1e21135",
"test_msg_authorize_coinjoin.py::test_no_anonymity": "fd09da284b650e893990b95047b63a35b6b695fc5301d595f17a6d2cf9d90bcb",

Loading…
Cancel
Save