From 36d8a31ff259e7d20f7969cdb0ee3ebd0385d74b Mon Sep 17 00:00:00 2001 From: Ollrogge Date: Wed, 8 Sep 2021 09:26:21 +0200 Subject: [PATCH] Change expected error codes of some tests --- tests/standard/fido2/pin/test_pin.py | 6 +++--- tests/standard/fido2/user_presence/test_user_presence.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/standard/fido2/pin/test_pin.py b/tests/standard/fido2/pin/test_pin.py index 78b09e3..9bc816d 100644 --- a/tests/standard/fido2/pin/test_pin.py +++ b/tests/standard/fido2/pin/test_pin.py @@ -60,7 +60,7 @@ def test_set_pin_twice(self, device, SetPinRes): with pytest.raises(CtapError) as e: device.client.pin_protocol.set_pin('1234') - assert e.value.code == CtapError.ERR.NOT_ALLOWED + assert e.value.code == CtapError.ERR.PIN_AUTH_INVALID def test_get_key_agreement_fields(self, CPRes): @@ -99,11 +99,11 @@ def test_get_no_pin_auth(self, device, SetPinRes): def test_zero_length_pin_auth(self, device, SetPinRes): with pytest.raises(CtapError) as e: reg = device.sendMC(*FidoRequest(SetPinRes, pin_auth=b"").toMC()) - assert e.value.code == CtapError.ERR.PIN_AUTH_INVALID + assert e.value.code == CtapError.ERR.PIN_INVALID with pytest.raises(CtapError) as e: reg = device.sendGA(*FidoRequest(SetPinRes, pin_auth=b"").toGA()) - assert e.value.code == CtapError.ERR.PIN_AUTH_INVALID + assert e.value.code == CtapError.ERR.PIN_INVALID def test_make_credential_no_pin(self, device, SetPinRes): with pytest.raises(CtapError) as e: diff --git a/tests/standard/fido2/user_presence/test_user_presence.py b/tests/standard/fido2/user_presence/test_user_presence.py index c9904b2..3b32ad0 100644 --- a/tests/standard/fido2/user_presence/test_user_presence.py +++ b/tests/standard/fido2/user_presence/test_user_presence.py @@ -34,7 +34,7 @@ def test_no_user_presence(self, device, MCRes, GARes): device.sendGA( *FidoRequest(GARes, timeout=event, on_keepalive=None).toGA() ) - assert e.value.code == CtapError.ERR.KEEPALIVE_CANCEL + assert e.value.code == CtapError.ERR.OPERATION_DENIED @pytest.mark.skipif( not "trezor" in sys.argv, reason="Only Trezor supports decline."