mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-24 23:38:09 +00:00
tests: rename test_address to get_test_address
so that pytest doesn't think it is a testcase
This commit is contained in:
parent
3dbd9c9eca
commit
e9555a3b0a
@ -169,5 +169,7 @@ def read_and_confirm_mnemonic(debug, words):
|
||||
return " ".join(mnemonic)
|
||||
|
||||
|
||||
def test_address(client):
|
||||
def get_test_address(client):
|
||||
"""Fetch a testnet address on a fixed path. Useful to make a pin/passphrase
|
||||
protected call, or to identify the root secret (seed+passphrase)"""
|
||||
return btc.get_address(client, "Testnet", TEST_ADDRESS_N)
|
||||
|
@ -23,7 +23,7 @@ from ..common import (
|
||||
MNEMONIC12,
|
||||
MNEMONIC_SLIP39_ADVANCED_20,
|
||||
MNEMONIC_SLIP39_BASIC_20_3of6,
|
||||
test_address,
|
||||
get_test_address,
|
||||
)
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ class TestDeviceLoad:
|
||||
assert state.pin is None
|
||||
assert state.passphrase_protection is False
|
||||
|
||||
address = test_address(client)
|
||||
address = get_test_address(client)
|
||||
assert address == "mkqRFzxmkCGX9jxgpqqFHcxRUmLJcLDBer"
|
||||
|
||||
def test_load_device_2(self, client):
|
||||
@ -62,7 +62,7 @@ class TestDeviceLoad:
|
||||
assert state.pin == "1234"
|
||||
assert state.passphrase_protection is True
|
||||
|
||||
address = test_address(client)
|
||||
address = get_test_address(client)
|
||||
assert address == "mx77VZjTVixVsU7nCtAKHnGFdsyNCnsWWw"
|
||||
|
||||
@pytest.mark.skip_t1
|
||||
@ -116,7 +116,7 @@ class TestDeviceLoad:
|
||||
skip_checksum=True,
|
||||
)
|
||||
client.use_passphrase(passphrase_nfkd)
|
||||
address_nfkd = test_address(client)
|
||||
address_nfkd = get_test_address(client)
|
||||
|
||||
device.wipe(client)
|
||||
debuglink.load_device(
|
||||
@ -129,7 +129,7 @@ class TestDeviceLoad:
|
||||
skip_checksum=True,
|
||||
)
|
||||
client.use_passphrase(passphrase_nfc)
|
||||
address_nfc = test_address(client)
|
||||
address_nfc = get_test_address(client)
|
||||
|
||||
device.wipe(client)
|
||||
debuglink.load_device(
|
||||
@ -142,7 +142,7 @@ class TestDeviceLoad:
|
||||
skip_checksum=True,
|
||||
)
|
||||
client.use_passphrase(passphrase_nfkc)
|
||||
address_nfkc = test_address(client)
|
||||
address_nfkc = get_test_address(client)
|
||||
|
||||
device.wipe(client)
|
||||
debuglink.load_device(
|
||||
@ -155,7 +155,7 @@ class TestDeviceLoad:
|
||||
skip_checksum=True,
|
||||
)
|
||||
client.use_passphrase(passphrase_nfd)
|
||||
address_nfd = test_address(client)
|
||||
address_nfd = get_test_address(client)
|
||||
|
||||
assert address_nfkd == address_nfc
|
||||
assert address_nfkd == address_nfkc
|
||||
|
@ -19,7 +19,7 @@ import pytest
|
||||
from ..common import (
|
||||
MNEMONIC_SLIP39_ADVANCED_20,
|
||||
MNEMONIC_SLIP39_ADVANCED_33,
|
||||
test_address,
|
||||
get_test_address,
|
||||
)
|
||||
|
||||
|
||||
@ -33,12 +33,12 @@ def test_128bit_passphrase(client):
|
||||
"""
|
||||
assert client.features.passphrase_protection is True
|
||||
client.use_passphrase("TREZOR")
|
||||
address = test_address(client)
|
||||
address = get_test_address(client)
|
||||
assert address == "mkKDUMRR1CcK8eLAzCZAjKnNbCquPoWPxN"
|
||||
client.state = None
|
||||
client.clear_session()
|
||||
client.use_passphrase("ROZERT")
|
||||
address_compare = test_address(client)
|
||||
address_compare = get_test_address(client)
|
||||
assert address != address_compare
|
||||
|
||||
|
||||
@ -52,10 +52,10 @@ def test_256bit_passphrase(client):
|
||||
"""
|
||||
assert client.features.passphrase_protection is True
|
||||
client.use_passphrase("TREZOR")
|
||||
address = test_address(client)
|
||||
address = get_test_address(client)
|
||||
assert address == "mxVtGxUJ898WLzPMmy6PT1FDHD1GUCWGm7"
|
||||
client.state = None
|
||||
client.clear_session()
|
||||
client.use_passphrase("ROZERT")
|
||||
address_compare = test_address(client)
|
||||
address_compare = get_test_address(client)
|
||||
assert address != address_compare
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
import pytest
|
||||
|
||||
from ..common import MNEMONIC_SLIP39_BASIC_20_3of6, test_address
|
||||
from ..common import MNEMONIC_SLIP39_BASIC_20_3of6, get_test_address
|
||||
|
||||
|
||||
@pytest.mark.setup_client(mnemonic=MNEMONIC_SLIP39_BASIC_20_3of6, passphrase=True)
|
||||
@ -29,7 +29,7 @@ def test_3of6_passphrase(client):
|
||||
"""
|
||||
assert client.features.passphrase_protection is True
|
||||
client.use_passphrase("TREZOR")
|
||||
address = test_address(client)
|
||||
address = get_test_address(client)
|
||||
assert address == "mi4HXfRJAqCDyEdet5veunBvXLTKSxpuim"
|
||||
|
||||
|
||||
@ -49,5 +49,5 @@ def test_2of5_passphrase(client):
|
||||
"""
|
||||
assert client.features.passphrase_protection is True
|
||||
client.use_passphrase("TREZOR")
|
||||
address = test_address(client)
|
||||
address = get_test_address(client)
|
||||
assert address == "mjXH4pN7TtbHp3tWLqVKktKuaQeByHMoBZ"
|
||||
|
Loading…
Reference in New Issue
Block a user