From 7200af7547fadebc0dd3f815a19916d5cc437020 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Thu, 14 Mar 2024 16:26:31 +0100 Subject: [PATCH] Improve test slightly --- core/tests/test_trezor.wire.thp_v1.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/core/tests/test_trezor.wire.thp_v1.py b/core/tests/test_trezor.wire.thp_v1.py index 5ba3e67a3..a3120d43e 100644 --- a/core/tests/test_trezor.wire.thp_v1.py +++ b/core/tests/test_trezor.wire.thp_v1.py @@ -101,12 +101,10 @@ class TestWireTrezorHostProtocolV1(unittest.TestCase): gen = thp_v1.read_message(self.interface, buffer) query = gen.send(None) self.assertObjectEqual(query, self.interface.wait_object(io.POLL_READ)) - + gen.send(cid_req_message) + gen.send(None) + gen.send(message) with self.assertRaises(StopIteration) as e: - gen.send(cid_req_message) - gen.send(None) - gen.send(message) - gen.send(None) gen.send(None) # e.value is StopIteration. e.value.value is the return value of the call @@ -133,10 +131,8 @@ class TestWireTrezorHostProtocolV1(unittest.TestCase): query = gen.send(None) self.assertObjectEqual(query, self.interface.wait_object(io.POLL_READ)) - + gen.send(message) with self.assertRaises(StopIteration) as e: - gen.send(message) - gen.send(None) gen.send(None) # e.value is StopIteration. e.value.value is the return value of the call @@ -211,9 +207,8 @@ class TestWireTrezorHostProtocolV1(unittest.TestCase): gen = thp_v1.read_message(self.interface, buffer) query = gen.send(None) self.assertObjectEqual(query, self.interface.wait_object(io.POLL_READ)) + gen.send(packet) with self.assertRaises(StopIteration) as e: - gen.send(packet) - gen.send(None) gen.send(None) # e.value is StopIteration. e.value.value is the return value of the call