From 4f866686fa2a325bbf847f6fc7aa957aa6e1157b Mon Sep 17 00:00:00 2001 From: Sarah GLINER Date: Fri, 8 Mar 2024 17:10:12 +0100 Subject: [PATCH] fixup! tests: udpdate with ragger client --- tests/instructions.py | 68 ++++++------------------------- tests/test_e2e_miniscript.py | 25 ++++++------ tests/test_e2e_multisig.py | 15 +++---- tests/test_e2e_tapscripts.py | 26 ++++++------ tests/test_get_extended_pubkey.py | 2 +- tests/test_protocol.py | 6 ++- tests/test_register_wallet_v1.py | 12 +++--- tests/test_sign_message.py | 5 ++- 8 files changed, 62 insertions(+), 97 deletions(-) diff --git a/tests/instructions.py b/tests/instructions.py index 58fe3cffd..b03aa4466 100644 --- a/tests/instructions.py +++ b/tests/instructions.py @@ -101,60 +101,6 @@ def register_wallet_instruction_approve(model: Firmware) -> Instructions: return instructions -def register_wallet_instruction_approve_16(model: Firmware) -> Instructions: - instructions = Instructions(model) - - if model.name.startswith("nano"): - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - instructions.new_request("Approve", save_screenshot=False) - else: - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - instructions.choice_confirm(save_screenshot=False) - return instructions - - def register_wallet_instruction_approve_long(model: Firmware) -> Instructions: instructions = Instructions(model) @@ -387,7 +333,19 @@ def sign_psbt_instruction_approve_10(model: Firmware) -> Instructions: return instructions -def tapscript_instruction(model: Firmware) -> Instructions: +def e2e_register_wallet_instruction(model: Firmware) -> Instructions: + instructions = Instructions(model) + + if model.name.startswith("nano"): + for _ in range(23): + instructions.new_request("Approve", save_screenshot=False) + else: + for _ in range(23): + instructions.choice_confirm(save_screenshot=False) + return instructions + + +def e2e_sign_psbt_instruction(model: Firmware) -> Instructions: instructions = Instructions(model) if model.name.startswith("nano"): diff --git a/tests/test_e2e_miniscript.py b/tests/test_e2e_miniscript.py index b348e482b..6c9b35078 100644 --- a/tests/test_e2e_miniscript.py +++ b/tests/test_e2e_miniscript.py @@ -14,11 +14,12 @@ from test_utils import SpeculosGlobals, get_internal_xpub, count_internal_keys from ragger_bitcoin import RaggerClient +from ragger_bitcoin.instructions import Instructions from ragger.navigator import Navigator, NavInsID from ragger.firmware import Firmware from ragger.error import ExceptionRAPDU -from .instructions import Instructions, register_wallet_instruction_approve_16, tapscript_instruction +from .instructions import e2e_register_wallet_instruction, e2e_sign_psbt_instruction from .conftest import create_new_wallet, generate_blocks, get_unique_wallet_name, get_wallet_rpc, testnet_to_regtest_addr as T from .conftest import AuthServiceProxy @@ -160,7 +161,7 @@ def test_e2e_miniscript_one_of_two_1(navigator: Navigator, firmware: Firmware, c ]) run_test_e2e(navigator, client, wallet_policy, [], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_miniscript_one_of_two_2(navigator: Navigator, firmware: Firmware, client: RaggerClient, @@ -180,7 +181,7 @@ def test_e2e_miniscript_one_of_two_2(navigator: Navigator, firmware: Firmware, c ]) run_test_e2e(navigator, client, wallet_policy, [_], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_miniscript_2fa(navigator: Navigator, firmware: Firmware, client: RaggerClient, @@ -200,7 +201,7 @@ def test_e2e_miniscript_2fa(navigator: Navigator, firmware: Firmware, client: Ra ]) run_test_e2e(navigator, client, wallet_policy, [core_wallet_name], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_miniscript_decaying_3of3(navigator: Navigator, firmware: Firmware, client: @@ -222,7 +223,7 @@ def test_e2e_miniscript_decaying_3of3(navigator: Navigator, firmware: Firmware, ]) run_test_e2e(navigator, client, wallet_policy, [core_wallet_name1, core_wallet_name2], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_miniscript_bolt3_offered_htlc(navigator: Navigator, firmware: Firmware, client: @@ -245,7 +246,7 @@ def test_e2e_miniscript_bolt3_offered_htlc(navigator: Navigator, firmware: Firmw ]) run_test_e2e(navigator, client, wallet_policy, [core_wallet_name1, core_wallet_name2], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_miniscript_bolt3_received_htlc(navigator: Navigator, firmware: Firmware, client: @@ -268,7 +269,7 @@ def test_e2e_miniscript_bolt3_received_htlc(navigator: Navigator, firmware: Firm ]) run_test_e2e(navigator, client, wallet_policy, [core_wallet_name1, core_wallet_name2], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_miniscript_me_or_3of5(navigator: Navigator, firmware: Firmware, client: @@ -295,7 +296,7 @@ def test_e2e_miniscript_me_or_3of5(navigator: Navigator, firmware: Firmware, cli ]) run_test_e2e(navigator, client, wallet_policy, [], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_miniscript_me_large_vault(navigator: Navigator, firmware: Firmware, client: @@ -327,7 +328,7 @@ def test_e2e_miniscript_me_large_vault(navigator: Navigator, firmware: Firmware, ]) run_test_e2e(navigator, client, wallet_policy, [], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_miniscript_me_and_bob_or_me_and_carl_1(navigator: Navigator, firmware: Firmware, @@ -356,7 +357,7 @@ def test_e2e_miniscript_me_and_bob_or_me_and_carl_1(navigator: Navigator, firmwa ]) run_test_e2e(navigator, client, wallet_policy, [core_wallet_name1], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_miniscript_nanos_large_policy(navigator: Navigator, firmware: Firmware, client: @@ -390,7 +391,7 @@ def test_e2e_miniscript_nanos_large_policy(navigator: Navigator, firmware: Firmw run_test_e2e(navigator, client, wallet_policy, [core_wallet_name1, core_wallet_name2, core_wallet_name3], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_miniscript_policy_with_a(navigator: Navigator, firmware: Firmware, client: @@ -420,7 +421,7 @@ def test_e2e_miniscript_policy_with_a(navigator: Navigator, firmware: Firmware, ]) run_test_e2e(navigator, client, wallet_policy, [core_wallet_name3], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_invalid_miniscript(navigator: Navigator, firmware: Firmware, client: RaggerClient, diff --git a/tests/test_e2e_multisig.py b/tests/test_e2e_multisig.py index 25ed22072..7d8082e21 100644 --- a/tests/test_e2e_multisig.py +++ b/tests/test_e2e_multisig.py @@ -16,10 +16,11 @@ from speculos.client import SpeculosClient from ragger_bitcoin import RaggerClient +from ragger_bitcoin.instructions import Instructions from ragger.navigator import Navigator, NavInsID from ragger.firmware import Firmware -from .instructions import Instructions, register_wallet_instruction_approve_16, tapscript_instruction +from .instructions import e2e_register_wallet_instruction, e2e_sign_psbt_instruction from .conftest import create_new_wallet, generate_blocks, get_unique_wallet_name, get_wallet_rpc, testnet_to_regtest_addr as T from .conftest import AuthServiceProxy @@ -150,8 +151,8 @@ def test_e2e_multisig_2_of_2(navigator: Navigator, firmware: Firmware, client: R ) run_test(navigator, client, wallet_policy, [core_wallet_name], rpc, rpc_test_wallet, - speculos_globals, register_wallet_instruction_approve_16(firmware), - tapscript_instruction(firmware), test_name) + speculos_globals, e2e_register_wallet_instruction(firmware), + e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_multisig_multiple_internal_keys(navigator: Navigator, firmware: Firmware, client: @@ -183,8 +184,8 @@ def test_e2e_multisig_multiple_internal_keys(navigator: Navigator, firmware: Fir run_test(navigator, client, wallet_policy, [core_wallet_name_3], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), - tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), + e2e_sign_psbt_instruction(firmware), test_name) @pytest.mark.timeout(0) # disable timeout @@ -215,5 +216,5 @@ def test_e2e_multisig_16_of_16(navigator: Navigator, firmware: Firmware, client: ) run_test(navigator, client, wallet_policy, core_wallet_names, rpc, rpc_test_wallet, - speculos_globals. register_wallet_instruction_approve_16(firmware), - tapscript_instruction(firmware), test_name) + speculos_globals. e2e_register_wallet_instruction(firmware), + e2e_sign_psbt_instruction(firmware), test_name) diff --git a/tests/test_e2e_tapscripts.py b/tests/test_e2e_tapscripts.py index 5c0b8a070..095aa87c1 100644 --- a/tests/test_e2e_tapscripts.py +++ b/tests/test_e2e_tapscripts.py @@ -16,14 +16,14 @@ from test_utils import SpeculosGlobals, get_internal_xpub, count_internal_keys from ragger_bitcoin import RaggerClient +from ragger_bitcoin.instructions import Instructions from ragger.navigator import Navigator, NavInsID from ragger.firmware import Firmware from ragger.error import ExceptionRAPDU -from .instructions import Instructions, register_wallet_instruction_approve_16, tapscript_instruction - -from .conftest import create_new_wallet, generate_blocks, get_unique_wallet_name, get_wallet_rpc, testnet_to_regtest_addr as T +from .instructions import e2e_register_wallet_instruction, e2e_sign_psbt_instruction from .conftest import AuthServiceProxy +from .conftest import create_new_wallet, generate_blocks, get_unique_wallet_name, get_wallet_rpc, testnet_to_regtest_addr as T def run_test_e2e(navigator: Navigator, client: RaggerClient, wallet_policy: WalletPolicy, @@ -171,7 +171,7 @@ def test_e2e_tapscript_one_of_two_keypath(navigator: Navigator, firmware: Firmwa ]) run_test_e2e(navigator, client, wallet_policy, [], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_tapscript_one_of_two_scriptpath(navigator: Navigator, firmware: Firmware, client: @@ -191,7 +191,7 @@ def test_e2e_tapscript_one_of_two_scriptpath(navigator: Navigator, firmware: Fir ]) run_test_e2e(navigator, client, wallet_policy, [], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_tapscript_one_of_three_keypath(navigator: Navigator, firmware: Firmware, client: @@ -213,7 +213,7 @@ def test_e2e_tapscript_one_of_three_keypath(navigator: Navigator, firmware: Firm ]) run_test_e2e(navigator, client, wallet_policy, [], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_register_wallet_instruction(firmware), test_name) def test_e2e_tapscript_one_of_three_scriptpath(navigator: Navigator, firmware: Firmware, client: @@ -235,7 +235,7 @@ def test_e2e_tapscript_one_of_three_scriptpath(navigator: Navigator, firmware: F ]) run_test_e2e(navigator, client, wallet_policy, [], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_tapscript_multi_a_2of2(navigator: Navigator, firmware: Firmware, client: @@ -256,7 +256,7 @@ def test_e2e_tapscript_multi_a_2of2(navigator: Navigator, firmware: Firmware, cl ]) run_test_e2e(navigator, client, wallet_policy, [core_wallet_name2], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_tapscript_maxdepth(navigator: Navigator, firmware: Firmware, client: RaggerClient, @@ -286,7 +286,7 @@ def test_e2e_tapscript_maxdepth(navigator: Navigator, firmware: Firmware, client keys_info=keys_info) run_test_e2e(navigator, client, wallet_policy, [], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_tapscript_large(navigator: Navigator, firmware: Firmware, client: RaggerClient, @@ -320,7 +320,7 @@ def test_e2e_tapscript_large(navigator: Navigator, firmware: Firmware, client: R keys_info=keys_info) run_test_e2e(navigator, client, wallet_policy, [core_wallet_name], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_tapminiscript_keypath_or_decaying_3of3(navigator: Navigator, firmware: Firmware, @@ -345,7 +345,7 @@ def test_e2e_tapminiscript_keypath_or_decaying_3of3(navigator: Navigator, firmwa ]) run_test_e2e(navigator, client, wallet_policy, [core_name_2, core_name_3], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_tapminiscript_with_hash256(navigator: Navigator, firmware: Firmware, client: @@ -367,7 +367,7 @@ def test_e2e_tapminiscript_with_hash256(navigator: Navigator, firmware: Firmware ]) run_test_e2e(navigator, client, wallet_policy, [core_name_3], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_e2e_tapminiscript_mixed_leaves(navigator: Navigator, firmware: Firmware, client: @@ -392,7 +392,7 @@ def test_e2e_tapminiscript_mixed_leaves(navigator: Navigator, firmware: Firmware ]) run_test_e2e(navigator, client, wallet_policy, [], rpc, rpc_test_wallet, speculos_globals, - register_wallet_instruction_approve_16(firmware), tapscript_instruction(firmware), test_name) + e2e_register_wallet_instruction(firmware), e2e_sign_psbt_instruction(firmware), test_name) def test_invalid_tapminiscript(navigator: Navigator, firmware: Firmware, client: RaggerClient, diff --git a/tests/test_get_extended_pubkey.py b/tests/test_get_extended_pubkey.py index 7f26671b7..7bb8c00c8 100644 --- a/tests/test_get_extended_pubkey.py +++ b/tests/test_get_extended_pubkey.py @@ -127,5 +127,5 @@ def test_get_extended_pubkey_non_standard_reject(navigator: Navigator, firmware: instructions=pubkey_reject(firmware), testname=test_name, ) - assert e.value.status == 0x6985 + assert DeviceException.exc.get(e.value.status) == DenyError assert len(e.value.data) == 0 diff --git a/tests/test_protocol.py b/tests/test_protocol.py index 0d849d647..670ea6859 100644 --- a/tests/test_protocol.py +++ b/tests/test_protocol.py @@ -1,7 +1,9 @@ import pytest -from ledger_bitcoin.client_base import ApduException from ledger_bitcoin.command_builder import BitcoinCommandBuilder, BitcoinInsType, CURRENT_PROTOCOL_VERSION +from ledger_bitcoin.exception.errors import WrongP1P2Error +from ledger_bitcoin.exception.device_exception import DeviceException + from ragger.error import ExceptionRAPDU from ragger_bitcoin import RaggerClient @@ -32,5 +34,5 @@ def test_p2_too_high(client: RaggerClient): p2=CURRENT_PROTOCOL_VERSION + 1, data=b'' ) - assert e.value.status == 0x6a86 + assert DeviceException.exc.get(e.value.status) == WrongP1P2Error assert len(e.value.data) == 0 diff --git a/tests/test_register_wallet_v1.py b/tests/test_register_wallet_v1.py index c9a8074d5..bcea05160 100644 --- a/tests/test_register_wallet_v1.py +++ b/tests/test_register_wallet_v1.py @@ -2,7 +2,9 @@ # Make sure we remain compatible for some time. from ledger_bitcoin import AddressType, MultisigWallet, WalletPolicy, WalletType -from ledger_bitcoin.exception.errors import IncorrectDataError, NotSupportedError +from ledger_bitcoin.exception.errors import IncorrectDataError, NotSupportedError, DenyError +from ledger_bitcoin.exception.device_exception import DeviceException + from ragger.error import ExceptionRAPDU from ragger.navigator import Navigator, NavInsID from ragger.firmware import Firmware @@ -109,7 +111,7 @@ def test_register_wallet_reject_header_v1(navigator: Navigator, firmware: Firmwa instructions=register_wallet_instruction_reject(firmware), testname=test_name) - assert e.value.status == 0x6985 + assert DeviceException.exc.get(e.value.status) == DenyError assert len(e.value.data) == 0 @@ -135,7 +137,7 @@ def test_register_wallet_invalid_names_v1(navigator: Navigator, firmware: Firmwa with pytest.raises(ExceptionRAPDU) as e: client.register_wallet(wallet, navigator) - assert e.value.status == 0x6A80 + assert DeviceException.exc.get(e.value.status) == IncorrectDataError assert len(e.value.data) == 0 @@ -156,7 +158,7 @@ def test_register_wallet_unsupported_policy_v1(navigator: Navigator, firmware: F testname=test_name) # NotSupportedError - assert e.value.status == 0x6A82 + assert DeviceException.exc.get(e.value.status) == NotSupportedError assert len(e.value.data) == 0 with pytest.raises(ExceptionRAPDU) as e: @@ -175,5 +177,5 @@ def test_register_wallet_unsupported_policy_v1(navigator: Navigator, firmware: F testname=test_name) # NotSupportedError - assert e.value.status == 0x6A82 + assert DeviceException.exc.get(e.value.status) == NotSupportedError assert len(e.value.data) == 0 diff --git a/tests/test_sign_message.py b/tests/test_sign_message.py index f5fa16b7a..34f422469 100644 --- a/tests/test_sign_message.py +++ b/tests/test_sign_message.py @@ -1,6 +1,7 @@ import pytest from ledger_bitcoin.exception.errors import DenyError +from ledger_bitcoin.exception.device_exception import DeviceException from ragger.navigator import Navigator from ragger.firmware import Firmware from ragger.error import ExceptionRAPDU @@ -55,7 +56,7 @@ def test_sign_message_reject(navigator: Navigator, firmware: Firmware, client: R testname=test_name ) - assert e.value.status == 0x6985 + assert DeviceException.exc.get(e.value.status) == DenyError assert len(e.value.data) == 0 @@ -98,5 +99,5 @@ def test_sign_message_hash_reject(navigator: Navigator, firmware: Firmware, clie testname=test_name ) - assert e.value.status == 0x6985 + assert DeviceException.exc.get(e.value.status) == DenyError assert len(e.value.data) == 0