1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-16 17:42:02 +00:00

tests: use new trezorlib locking/sessioning API where appropriate

This commit is contained in:
matejcik 2020-08-25 16:28:32 +02:00 committed by matejcik
parent a08c34a624
commit 46eb223b2a
3 changed files with 6 additions and 6 deletions

View File

@ -27,7 +27,7 @@ pytestmark = pytest.mark.skip_t2
def _check_pin(client, pin):
client.clear_session()
client.lock()
with client:
client.use_pin_sequence([pin])
client.set_expected_responses([messages.PinMatrixRequest(), messages.Address()])
@ -35,7 +35,7 @@ def _check_pin(client, pin):
def _check_no_pin(client):
client.clear_session()
client.lock()
with client:
client.set_expected_responses([messages.Address()])
client.call(messages.GetAddress())

View File

@ -27,7 +27,7 @@ pytestmark = pytest.mark.skip_t1
def _check_pin(client, pin):
client.clear_session()
client.lock()
assert client.features.pin_protection is True
assert client.features.unlocked is False
@ -38,7 +38,7 @@ def _check_pin(client, pin):
def _check_no_pin(client):
client.clear_session()
client.lock()
assert client.features.pin_protection is False
with client:

View File

@ -35,7 +35,7 @@ def test_128bit_passphrase(client):
client.use_passphrase("TREZOR")
address = get_test_address(client)
assert address == "mkKDUMRR1CcK8eLAzCZAjKnNbCquPoWPxN"
client.state = None
client.clear_session()
client.use_passphrase("ROZERT")
address_compare = get_test_address(client)
@ -54,7 +54,7 @@ def test_256bit_passphrase(client):
client.use_passphrase("TREZOR")
address = get_test_address(client)
assert address == "mxVtGxUJ898WLzPMmy6PT1FDHD1GUCWGm7"
client.state = None
client.clear_session()
client.use_passphrase("ROZERT")
address_compare = get_test_address(client)