diff --git a/trezor_agent/tests/test_client.py b/trezor_agent/tests/test_client.py index c12b320..438d7cb 100644 --- a/trezor_agent/tests/test_client.py +++ b/trezor_agent/tests/test_client.py @@ -1,6 +1,7 @@ import io import mock +import pytest from .. import client, factory, formats, util @@ -112,6 +113,14 @@ def test_ssh_agent(): assert s[:1] == b'\x00' assert r[1:] + s[1:] == SIG[1:] + c.client.call_exception = ValueError + def cancel_sign_identity(identity, challenge_hidden, + challenge_visual, ecdsa_curve_name): + raise c.client.call_exception(42, 'ERROR') + + c.client.sign_identity = cancel_sign_identity + with pytest.raises(IOError): + c.sign_ssh_challenge(label=label, blob=BLOB, visual='VISUAL') def test_utils(): identity = mock.Mock(spec=[])