From 25631221c54baf3764af6b5fc363f62b073eb0f5 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 7 Mar 2014 22:38:16 +0100 Subject: [PATCH] fix test_word_fail in test_msg_recoverydevice --- tests/test_msg_recoverydevice.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_msg_recoverydevice.py b/tests/test_msg_recoverydevice.py index da9eaa7252..2125e9dea9 100644 --- a/tests/test_msg_recoverydevice.py +++ b/tests/test_msg_recoverydevice.py @@ -60,10 +60,12 @@ class TestDeviceRecovery(common.TrezorTest): # Do passphrase-protected action, PassphraseRequest should be raised resp = self.client.call_raw(proto.Ping(passphrase_protection=True)) self.assertIsInstance(resp, proto.PassphraseRequest) + self.client.call_raw(proto.Cancel()) # Do PIN-protected action, PinRequest should be raised resp = self.client.call_raw(proto.Ping(pin_protection=True)) self.assertIsInstance(resp, proto.PinMatrixRequest) + self.client.call_raw(proto.Cancel()) def test_nopin_nopassphrase(self): mnemonic = self.mnemonic12.split(' ') @@ -127,15 +129,15 @@ class TestDeviceRecovery(common.TrezorTest): self.client.debug.press_yes() ret = self.client.call_raw(proto.ButtonAck()) + self.assertIsInstance(ret, proto.WordRequest) for _ in range(int(12 * 1.5)): - self.assertIsInstance(ret, proto.WordRequest) (word, pos) = self.client.debug.read_recovery_word() - if pos != 0: - ret = self.client.call_raw(proto.WordAck('kwyjibo')) + ret = self.client.call_raw(proto.WordAck(word='kwyjibo')) self.assertIsInstance(ret, proto.Failure) + break else: - ret = self.client.call_raw(proto.WordAck(word=word)) + self.client.call_raw(proto.WordAck(word=word)) def test_pin_fail(self): ret = self.client.call_raw(proto.RecoveryDevice(word_count=12,