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:
parent
a08c34a624
commit
46eb223b2a
@ -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())
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user