1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

add test for failed word in recovery device

This commit is contained in:
Pavol Rusnak 2014-03-07 21:51:01 +01:00
parent 4fc8868589
commit da6ce3acb8

View File

@ -115,6 +115,28 @@ class TestDeviceRecovery(common.TrezorTest):
resp = self.client.call_raw(proto.Ping(pin_protection=True))
self.assertIsInstance(resp, proto.Success)
def test_word_fail(self):
ret = self.client.call_raw(proto.RecoveryDevice(word_count=12,
passphrase_protection=False,
pin_protection=False,
label='label',
language='english',
enforce_wordlist=True))
self.assertIsInstance(ret, proto.ButtonRequest)
self.client.debug.press_yes()
ret = self.client.call_raw(proto.ButtonAck())
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'))
self.assertIsInstance(ret, proto.Failure)
else:
ret = self.client.call_raw(proto.WordAck(word=word))
def test_pin_fail(self):
ret = self.client.call_raw(proto.RecoveryDevice(word_count=12,
passphrase_protection=True,