Skip to content

Commit 9211823

Browse files
committed
fix: BIP-39 test expects Failure not ButtonRequest, manual screenshot
Firmware sends Failure directly (no confirm dialog). The test asserts Failure + message text, then manually calls _capture_oled() to capture the warning screen. Works with is_animating() guard.
1 parent 22faffe commit 9211823

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tests/test_msg_recoverydevice_cipher.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,16 @@ def test_invalid_bip39_word_rejected(self):
197197
self.assertIsInstance(ret, proto.CharacterRequest)
198198
ret = self.client.call_raw(proto.CharacterAck(character=' '))
199199

200-
# Firmware shows "Invalid Word / Word not found in BIP39 wordlist"
201-
# on OLED via confirm() — ButtonRequest pauses for screenshot capture
202-
self.assertIsInstance(ret, proto.ButtonRequest)
203-
self.client.debug.press_yes()
204-
ret = self.client.call_raw(proto.ButtonAck())
205-
206-
# Firmware should reject with Failure — word not in BIP-39 wordlist
200+
# Firmware rejects immediately with Failure — word not in BIP-39 wordlist
207201
self.assertIsInstance(ret, proto.Failure)
208202
self.assertIn("Word not found", ret.message)
209203

204+
# Capture the OLED rejection screen via DebugLink
205+
# The firmware renders "Word not in wordlist" before sending Failure
206+
import os as _os
207+
if _os.environ.get('KEEPKEY_SCREENSHOT') == '1' and self.client.debug:
208+
self.client._capture_oled()
209+
210210
def test_backspace(self):
211211
mnemonic = self.mnemonic12
212212
ret = self.client.call_raw(proto.RecoveryDevice(word_count=12,

0 commit comments

Comments
 (0)