chore(tests): change all the model-specific variables for button_requests to start with "is_"

[no changelog]
pull/3256/head
grdddj 9 months ago committed by Jiří Musil
parent 2ca3c4c83b
commit d88da792f1

@ -616,7 +616,7 @@ def test_p2wpkh_with_proof(client: Client):
)
with client:
t1 = client.features.model == "1"
is_t1 = client.features.model == "1"
tt = client.features.model == "T"
client.set_expected_responses(
[
@ -643,7 +643,7 @@ def test_p2wpkh_with_proof(client: Client):
request_input(1),
request_output(0),
request_output(1),
(t1, request_input(0)),
(is_t1, request_input(0)),
request_input(1),
request_finished(),
]
@ -710,7 +710,7 @@ def test_p2tr_with_proof(client: Client):
)
with client:
t1 = client.features.model == "1"
is_t1 = client.features.model == "1"
tt = client.features.model == "T"
client.set_expected_responses(
[
@ -723,7 +723,7 @@ def test_p2tr_with_proof(client: Client):
request_input(0),
request_input(1),
request_output(0),
(t1, request_input(0)),
(is_t1, request_input(0)),
request_input(1),
request_finished(),
]

@ -115,7 +115,7 @@ def test_p2pkh_fee_bump(client: Client):
orig_index=1,
)
new_model = client.features.model in ("T", "R")
is_core = client.features.model in ("T", "R")
with client:
client.set_expected_responses(
@ -133,7 +133,7 @@ def test_p2pkh_fee_bump(client: Client):
request_meta(TXHASH_beafc7),
request_input(0, TXHASH_beafc7),
request_output(0, TXHASH_beafc7),
(new_model, request_orig_input(0, TXHASH_50f6f1)),
(is_core, request_orig_input(0, TXHASH_50f6f1)),
request_orig_input(0, TXHASH_50f6f1),
request_orig_output(0, TXHASH_50f6f1),
request_orig_output(1, TXHASH_50f6f1),
@ -600,7 +600,7 @@ def test_p2wpkh_in_p2sh_fee_bump_from_external(client: Client):
orig_index=0,
)
tr = client.features.model == "R"
is_tr = client.features.model == "R"
with client:
client.set_expected_responses(
[
@ -613,7 +613,7 @@ def test_p2wpkh_in_p2sh_fee_bump_from_external(client: Client):
request_output(0),
request_orig_output(0, TXHASH_334cd7),
messages.ButtonRequest(code=B.ConfirmOutput),
(not tr, messages.ButtonRequest(code=B.ConfirmOutput)),
(not is_tr, messages.ButtonRequest(code=B.ConfirmOutput)),
request_orig_output(1, TXHASH_334cd7),
messages.ButtonRequest(code=B.SignTx),
request_input(0),

@ -186,13 +186,13 @@ def test_data_streaming(client: Client):
checked in vectorized function above.
"""
with client:
t1 = client.features.model == "1"
tt = client.features.model == "T"
is_t1 = client.features.model == "1"
is_tt = client.features.model == "T"
client.set_expected_responses(
[
messages.ButtonRequest(code=messages.ButtonRequestType.SignTx),
(t1, messages.ButtonRequest(code=messages.ButtonRequestType.SignTx)),
(tt, messages.ButtonRequest(code=messages.ButtonRequestType.Other)),
(is_t1, messages.ButtonRequest(code=messages.ButtonRequestType.SignTx)),
(is_tt, messages.ButtonRequest(code=messages.ButtonRequestType.Other)),
messages.ButtonRequest(code=messages.ButtonRequestType.SignTx),
message_filters.EthereumTxRequest(
data_length=1_024,

@ -32,9 +32,9 @@ PIN4 = "1234"
@pytest.mark.setup_client(pin=PIN4, passphrase="")
def test_clear_session(client: Client):
is_trezor1 = client.features.model == "1"
is_t1 = client.features.model == "1"
init_responses = [
messages.PinMatrixRequest if is_trezor1 else messages.ButtonRequest,
messages.PinMatrixRequest if is_t1 else messages.ButtonRequest,
messages.PassphraseRequest,
]

Loading…
Cancel
Save