Skip to content

Commit 1ed34a7

Browse files
Merge pull request #34 from BitHighlander/fix/715-bitcoin-only-guard
test: gate the bitcoin-only suite on the bitcoin-only product
2 parents cf9dcf6 + 1530421 commit 1ed34a7

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

tests/common.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,18 @@ def requires_fullFeature(self):
194194
self.client.features.firmware_variant == "EmulatorBTC":
195195
self.skipTest("Full feature firmware required to run this test")
196196

197+
def requires_bitcoinOnly(self):
198+
"""Inverse of requires_fullFeature(): skip unless this IS the
199+
bitcoin-only product.
200+
201+
Usable since the firmware learned to report the variant honestly --
202+
variant_getName() used to answer "Emulator" for both products, so a
203+
bitcoin-only emulator was indistinguishable from a full one and this
204+
guard could not be written.
205+
"""
206+
if self.client.features.firmware_variant not in ("KeepKeyBTC",
207+
"EmulatorBTC"):
208+
self.skipTest("Bitcoin-only firmware required to run this test")
209+
197210

198211

tests/test_msg_bitcoin_only_variant.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ class TestBitcoinOnlyVariant(common.KeepKeyTest):
100100
def setUp(self):
101101
super(TestBitcoinOnlyVariant, self).setUp()
102102
self.requires_firmware("7.15.0")
103+
# This whole file describes the BITCOIN-ONLY product. Several tests
104+
# assert screen sequences that differ on the multi-chain build -- the
105+
# OP_RETURN one decodes a THORChain memo there and draws more screens --
106+
# so running them against a full-feature device is a category error, not
107+
# a finding. CI points the pyk suite at the full emulator image.
108+
self.requires_bitcoinOnly()
103109
self.screens = []
104110
# Refuse (press NO) on the Nth ButtonRequest of the current flow;
105111
# None means confirm everything.

0 commit comments

Comments
 (0)