tests: clear session before each testcase

pull/1236/head
matejcik 4 years ago committed by matejcik
parent 46eb223b2a
commit e0ec5aa1e7

@ -128,9 +128,7 @@ def client(request):
no_backup=setup_params["no_backup"],
)
if setup_params["pin"]:
# ClearSession locks the device. We only do that if the PIN is set.
client.clear_session()
client.clear_session()
if run_ui_tests:
with ui_tests.screen_recording(client, request):

@ -29,6 +29,7 @@ class TestDebuglink:
@pytest.mark.setup_client(mnemonic=MNEMONIC12)
def test_mnemonic(self, client):
client.ensure_unlocked()
mnemonic = client.debug.state().mnemonic_secret
assert mnemonic == MNEMONIC12.encode()

@ -262,6 +262,7 @@ def test_backup_slip39_advanced(client):
# we only test this with bip39 because the code path is always the same
@pytest.mark.setup_client(no_backup=True)
def test_no_backup_fails(client):
client.ensure_unlocked()
assert client.features.initialized is True
assert client.features.no_backup is True
assert client.features.needs_backup is False
@ -274,6 +275,7 @@ def test_no_backup_fails(client):
# we only test this with bip39 because the code path is always the same
@pytest.mark.setup_client(needs_backup=True)
def test_interrupt_backup_fails(client):
client.ensure_unlocked()
assert client.features.initialized is True
assert client.features.needs_backup is True
assert client.features.unfinished_backup is False

@ -106,6 +106,7 @@ def test_set_remove_wipe_code(client):
def test_set_wipe_code_mismatch(client):
# Check that there is no wipe code protection.
client.ensure_unlocked()
assert client.features.wipe_code_protection is False
# Let's set a new wipe code.
@ -196,4 +197,5 @@ def test_set_wipe_code_invalid(client, invalid_wipe_code):
# Check that there's still no wipe code protection.
client.init_device()
client.ensure_unlocked()
assert client.features.wipe_code_protection is False

@ -21,9 +21,9 @@
"test_msg_authorize_coinjoin.py::test_sign_tx": "2838d4062333c241b6bbef7e680ec8a5764fe7bcaa41419e4141e146d3586a5d",
"test_msg_authorize_coinjoin.py::test_unfair_fee": "62314e936de46a6caaf02c8eb20f6f471be6e79ca0c5450cad6f67f9cb823f2b",
"test_msg_authorize_coinjoin.py::test_wrong_coordinator": "d8a608beb6165f5667cc44dcff6bdc17ebb4638ddd3bd09e7f0e1e75d1e21135",
"test_msg_backup_device.py::test_backup_bip39": "2b63928444b8188eb2241fc03a3b9bc81191cfa9bbf3ef5431894c04ee0ed01f",
"test_msg_backup_device.py::test_backup_slip39_advanced": "31900e0e8ad694ce894eee1ce289b425558c1fcd7bcb6128a19c049af436d35f",
"test_msg_backup_device.py::test_backup_slip39_basic": "be4d88d882851ce1ddc45165c35952b23121ddca1a811c7fd7c7ef9d31989e8c",
"test_msg_backup_device.py::test_backup_bip39": "42325cccfc0bd54db180a01a076437ec981022338307339bb5e0f6463d842e23",
"test_msg_backup_device.py::test_backup_slip39_advanced": "9a01aa5ecdafa52571ed2149575f86ffea6c2984a2541ea8e5f9a7c37cf4c9fe",
"test_msg_backup_device.py::test_backup_slip39_basic": "57d841257b10c4f67cf76487c8f0bc95947a93a8e0b8c03d7a11894da3c233da",
"test_msg_backup_device.py::test_interrupt_backup_fails": "8dc5c385fec6dd871a141e2efd83f767a5f3da85b2857c8ac27e054f9fa4b384",
"test_msg_backup_device.py::test_no_backup_fails": "93039a9472cfc9058563bd56e4a3dbe2e41af64744a61f6ee3255a04bd3a9366",
"test_msg_backup_device.py::test_no_backup_show_entropy_fails": "14fcdd2ded299ca099a35966cc9f21204b31de8d6bab9ec91cb64537bd70440c",
@ -93,15 +93,15 @@
"test_msg_cardano_sign_tx_slip39_basic.py::test_cardano_sign_tx[42-0-inputs2-outputs2-42-10-input_flo": "d488a0f2c127a675a1c2e2d410b6c4f402cdb610e19886a8998aa5ad786a779e",
"test_msg_cardano_sign_tx_slip39_basic.py::test_cardano_sign_tx[764824073-1-inputs0-outputs0-42-10-in": "6aa71de5007b0faf1eea4b1cfda1da6a739f852c0d875a1e59d83c03178c2f98",
"test_msg_cardano_sign_tx_slip39_basic.py::test_cardano_sign_tx[764824073-1-inputs1-outputs1-42-10-in": "7abf2e87a9b1e50afdf3502ba9480b07a59d59ccccf24915b46fb81285ae3fa8",
"test_msg_change_wipe_code_t2.py::test_set_pin_to_wipe_code": "9e11b251c03ef09127da79d92f8483c4db438c7303328774790d45e3f6fb8c96",
"test_msg_change_wipe_code_t2.py::test_set_pin_to_wipe_code": "b9c44290bfef91baa76a43fcf72e41092c716c79e5c21ccc368a817e8e52739f",
"test_msg_change_wipe_code_t2.py::test_set_remove_wipe_code": "d280ed129a2ea4781af9e35542aa31ecf63da75fc6812ed3bd05107809f836a4",
"test_msg_change_wipe_code_t2.py::test_set_wipe_code_mismatch": "32c808f00bada2059f933f3515337e494c837bdf65e4ea918b457d1c9f4cb42a",
"test_msg_change_wipe_code_t2.py::test_set_wipe_code_mismatch": "c128b6317db1219a88cea645aabead10eae7ba478f344af97b0b09b5cd4b1404",
"test_msg_change_wipe_code_t2.py::test_set_wipe_code_to_pin": "3c4072fa7e3def16258b2ed9c4fadf74a634b691889d78bbb771df616ea547af",
"test_msg_changepin_t2.py::test_change_failed": "9bf6e911c97e6a546b683b9b6b63933397deb018322a9d3469ca584afb440781",
"test_msg_changepin_t2.py::test_change_pin": "80f8169d54e417bf1a55c00e666498abbdd2788c9dd2d2d359c6528aa57f0d51",
"test_msg_changepin_t2.py::test_remove_pin": "90014e69558c0fd375077c1fa694997ab56799b3b1818398a9a63dc2751db4e5",
"test_msg_changepin_t2.py::test_change_failed": "6f759f27c33ba5bb43731f7532e3ec5b21a5c06c5b8a64e4d1d69e760b0003f0",
"test_msg_changepin_t2.py::test_change_pin": "5e3251031e1b221b34ad47c643c6e15af3480c22a0e44bfd89df08643267c76f",
"test_msg_changepin_t2.py::test_remove_pin": "b0eb22819b27451cf5807fd31894fc4674b9b5eb6f177eebcd3d0c33701efc4e",
"test_msg_changepin_t2.py::test_set_failed": "8c0844d3ec6e9d22a8e85e87c491e360291c26dc6ac0b6643e6292c3f6cb03a3",
"test_msg_changepin_t2.py::test_set_pin": "7a4656bcbdb6822562e6c42f99d441139bc174e25168007812a5d1c878e6af06",
"test_msg_changepin_t2.py::test_set_pin": "7957e51d5fd6ac93d4b508bcb7b170304c6548ab859cc445bb076074fd0a62d1",
"test_msg_cipherkeyvalue.py-test_decrypt": "166d85b1bf11aeaeb5b93ef5d047b6f8910c28b8fce1d853e6912d89d7bfca2f",
"test_msg_cipherkeyvalue.py-test_decrypt_badlen": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_cipherkeyvalue.py-test_encrypt": "3a37e4004c87bc6df6a8fa7c93b6fe3e3524986914709fda2f9c99ba0ff69775",

Loading…
Cancel
Save