1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-13 02:58:57 +00:00

chore(python): improve recovery type deprecation warning

This commit is contained in:
matejcik 2024-07-19 15:26:10 +02:00 committed by M1nd3r
parent d1625ab4a8
commit 834f1b4473
4 changed files with 9 additions and 5 deletions

View File

@ -175,6 +175,7 @@ def recover(
warnings.warn(
"Use type=RecoveryType.DryRun instead!",
DeprecationWarning,
stacklevel=3,
)
if type is not None:

View File

@ -94,7 +94,10 @@ def test_invalid_seed_core(client: Client):
IF = InputFlowBip39RecoveryDryRunInvalid(client)
client.set_input_flow(IF.get())
with pytest.raises(exceptions.Cancelled):
return device.recover(client, dry_run=True)
return device.recover(
client,
type=messages.RecoveryType.DryRun,
)
@pytest.mark.setup_client(uninitialized=True)

View File

@ -50,7 +50,7 @@ def test_2of3_dryrun(client: Client):
passphrase_protection=False,
pin_protection=False,
label="label",
dry_run=True,
type=messages.RecoveryType.DryRun,
)
# Dry run was successful
@ -74,5 +74,5 @@ def test_2of3_invalid_seed_dryrun(client: Client):
passphrase_protection=False,
pin_protection=False,
label="label",
dry_run=True,
type=messages.RecoveryType.DryRun,
)

View File

@ -46,7 +46,7 @@ def test_2of3_dryrun(client: Client):
passphrase_protection=False,
pin_protection=False,
label="label",
dry_run=True,
type=messages.RecoveryType.DryRun,
)
# Dry run was successful
@ -70,5 +70,5 @@ def test_2of3_invalid_seed_dryrun(client: Client):
passphrase_protection=False,
pin_protection=False,
label="label",
dry_run=True,
type=messages.RecoveryType.DryRun,
)