1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-23 11:35:42 +00:00

fixup! chore(tests): adapt testing framework to session based [no changelog]

This commit is contained in:
Martin Milata 2025-03-14 21:44:45 +01:00 committed by M1nd3r
parent 21361b0c77
commit af1c79a9f2
3 changed files with 14 additions and 5 deletions

View File

@ -227,6 +227,15 @@ class TrezorClient:
protocol = ProtocolV2Channel(self.transport, self.mapping)
return protocol
def reset_protocol(self):
if self._protocol_version == ProtocolVersion.PROTOCOL_V1:
self.protocol = ProtocolV1Channel(self.transport, self.mapping)
elif self._protocol_version == ProtocolVersion.PROTOCOL_V2:
self.protocol = ProtocolV2Channel(self.transport, self.mapping)
else:
assert False
self._features = None
def is_outdated(self) -> bool:
if self.features.bootloader_mode:
return False

View File

@ -1471,6 +1471,10 @@ class TrezorClientDebugLink(TrezorClient):
raise RuntimeError("Unexpected call")
def reset_protocol(self):
super().reset_protocol()
self._seedless_session = self.get_seedless_session(new_session=True)
def load_device(
session: "Session",

View File

@ -340,11 +340,7 @@ def _client_unlocked(
# Get a new client
_raw_client = _get_raw_client(request)
_raw_client.protocol = None
_raw_client.__init__(
transport=_raw_client.transport,
auto_interact=_raw_client.debug.allow_interactions,
)
_raw_client.reset_protocol()
if not _raw_client.features.bootloader_mode:
_raw_client.refresh_features()