From 3d379792f83fbcc703589e2455f7777cb17bd974 Mon Sep 17 00:00:00 2001 From: matejcik Date: Tue, 21 Nov 2023 16:55:46 +0100 Subject: [PATCH] tests: fix small irregularities --- tests/click_tests/test_lock.py | 3 +-- tests/input_flows.py | 6 +++--- tests/input_flows_helpers.py | 8 +++----- tests/persistence_tests/test_wipe_code.py | 4 +++- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/click_tests/test_lock.py b/tests/click_tests/test_lock.py index b4c0e1910..dc9872b51 100644 --- a/tests/click_tests/test_lock.py +++ b/tests/click_tests/test_lock.py @@ -76,8 +76,7 @@ def test_hold_to_lock(device_handler: "BackgroundDeviceHandler"): # unlock by touching if debug.model in (models.T2B1,): - # Doing a short HTC to simulate a click - layout = debug.press_right(hold_ms=100) + layout = debug.press_right() else: layout = debug.click(buttons.INFO) assert "PinKeyboard" in layout.all_components() diff --git a/tests/input_flows.py b/tests/input_flows.py index ee13764d6..74fb58098 100644 --- a/tests/input_flows.py +++ b/tests/input_flows.py @@ -853,15 +853,15 @@ class InputFlowSignTxInformationReplacement(InputFlowBase): yield # confirm txid self.debug.press_right() self.debug.press_right() - yield # confirm address + yield # modify amount - address self.debug.press_right() self.debug.press_right() + yield # modify amount - amount self.debug.press_right() - yield # confirm amount + yield # modify fee self.debug.press_right() self.debug.press_right() self.debug.press_right() - yield def input_flow_t3t1(self) -> BRGeneratorType: yield # confirm txid diff --git a/tests/input_flows_helpers.py b/tests/input_flows_helpers.py index 660843785..876be84ae 100644 --- a/tests/input_flows_helpers.py +++ b/tests/input_flows_helpers.py @@ -241,14 +241,12 @@ class RecoveryFlow: if has_groups: yield from self.success_share_group_entered() if self.client.model in (models.T2T1, models.T3T1) and click_info: - yield from self.tt_click_info() + yield + self.tt_click_info() yield from self.success_more_shares_needed() - def tt_click_info( - self, - ) -> BRGeneratorType: + def tt_click_info(self) -> None: # Moving through the INFO button - yield self.debug.press_info() self.debug.swipe_up() self.debug.press_yes() diff --git a/tests/persistence_tests/test_wipe_code.py b/tests/persistence_tests/test_wipe_code.py index 14abc30a3..46dd5a183 100644 --- a/tests/persistence_tests/test_wipe_code.py +++ b/tests/persistence_tests/test_wipe_code.py @@ -1,5 +1,6 @@ from trezorlib import debuglink, device, messages from trezorlib.debuglink import TrezorClientDebugLink as Client +from trezorlib.debuglink import message_filters from ..common import MNEMONIC12 from ..emulators import Emulator, EmulatorWrapper @@ -48,7 +49,8 @@ def test_wipe_code_activate_core(core_emulator: Emulator): ret = core_emulator.client.call_raw(messages.ButtonAck()) # Enter the wipe code instead of the current PIN - assert ret == messages.ButtonRequest(code=messages.ButtonRequestType.PinEntry) + expected = message_filters.ButtonRequest(code=messages.ButtonRequestType.PinEntry) + assert expected.match(ret) core_emulator.client._raw_write(messages.ButtonAck()) core_emulator.client.debug.input(WIPE_CODE)