From 4f66b37f25c4a61037563780fc38108ecc343984 Mon Sep 17 00:00:00 2001 From: matejcik Date: Wed, 18 Apr 2018 14:00:11 +0200 Subject: [PATCH] tests: update imports after tests.support move --- trezorlib/tests/device_tests/test_cosi.py | 7 ++++--- trezorlib/tests/device_tests/test_msg_getaddress.py | 6 ++++-- .../tests/device_tests/test_msg_getaddress_segwit.py | 4 ++-- .../device_tests/test_msg_getaddress_segwit_native.py | 4 ++-- trezorlib/tests/device_tests/test_msg_getaddress_show.py | 4 ++-- trezorlib/tests/device_tests/test_msg_getpublickey.py | 4 ++-- .../tests/device_tests/test_msg_getpublickey_curve.py | 3 +-- trezorlib/tests/device_tests/test_msg_signtx_bcash.py | 8 +++++--- .../tests/device_tests/test_msg_signtx_bitcoin_gold.py | 8 +++++--- trezorlib/tests/device_tests/test_msg_signtx_segwit.py | 6 +++--- .../tests/device_tests/test_msg_signtx_segwit_native.py | 6 ++++-- trezorlib/tests/device_tests/test_multisig.py | 7 +++---- trezorlib/tests/device_tests/test_multisig_change.py | 6 ++++-- trezorlib/tests/unit_tests/test_ckd_public.py | 2 +- 14 files changed, 42 insertions(+), 33 deletions(-) diff --git a/trezorlib/tests/device_tests/test_cosi.py b/trezorlib/tests/device_tests/test_cosi.py index d5d9c1790..08c60bdc9 100644 --- a/trezorlib/tests/device_tests/test_cosi.py +++ b/trezorlib/tests/device_tests/test_cosi.py @@ -16,10 +16,11 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * - +import pytest from hashlib import sha256 -from trezorlib import ed25519raw, ed25519cosi + +from .common import TrezorTest +from ..support import ed25519cosi, ed25519raw @pytest.mark.skip_t2 diff --git a/trezorlib/tests/device_tests/test_msg_getaddress.py b/trezorlib/tests/device_tests/test_msg_getaddress.py index e850e0393..a8e8936de 100644 --- a/trezorlib/tests/device_tests/test_msg_getaddress.py +++ b/trezorlib/tests/device_tests/test_msg_getaddress.py @@ -16,9 +16,11 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * +import pytest + +from .common import TrezorTest +from ..support import ckd_public as bip32 from trezorlib import messages as proto -import trezorlib.ckd_public as bip32 class TestMsgGetaddress(TrezorTest): diff --git a/trezorlib/tests/device_tests/test_msg_getaddress_segwit.py b/trezorlib/tests/device_tests/test_msg_getaddress_segwit.py index 8d34304a0..b4fcb6761 100644 --- a/trezorlib/tests/device_tests/test_msg_getaddress_segwit.py +++ b/trezorlib/tests/device_tests/test_msg_getaddress_segwit.py @@ -15,8 +15,8 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * -import trezorlib.ckd_public as bip32 +from .common import TrezorTest +from ..support import ckd_public as bip32 from trezorlib import messages as proto diff --git a/trezorlib/tests/device_tests/test_msg_getaddress_segwit_native.py b/trezorlib/tests/device_tests/test_msg_getaddress_segwit_native.py index d0c5cf01f..4bdb6d3a1 100644 --- a/trezorlib/tests/device_tests/test_msg_getaddress_segwit_native.py +++ b/trezorlib/tests/device_tests/test_msg_getaddress_segwit_native.py @@ -15,8 +15,8 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * -import trezorlib.ckd_public as bip32 +from .common import TrezorTest +from ..support import ckd_public as bip32 from trezorlib import messages as proto diff --git a/trezorlib/tests/device_tests/test_msg_getaddress_show.py b/trezorlib/tests/device_tests/test_msg_getaddress_show.py index 5ea4f45a3..ba9411ceb 100644 --- a/trezorlib/tests/device_tests/test_msg_getaddress_show.py +++ b/trezorlib/tests/device_tests/test_msg_getaddress_show.py @@ -16,8 +16,8 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * -import trezorlib.ckd_public as bip32 +from .common import TrezorTest +from ..support import ckd_public as bip32 from trezorlib import messages as proto diff --git a/trezorlib/tests/device_tests/test_msg_getpublickey.py b/trezorlib/tests/device_tests/test_msg_getpublickey.py index 77e254792..5047cd74c 100644 --- a/trezorlib/tests/device_tests/test_msg_getpublickey.py +++ b/trezorlib/tests/device_tests/test_msg_getpublickey.py @@ -16,8 +16,8 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * -import trezorlib.ckd_public as bip32 +from .common import TrezorTest +from ..support import ckd_public as bip32 class TestMsgGetpublickey(TrezorTest): diff --git a/trezorlib/tests/device_tests/test_msg_getpublickey_curve.py b/trezorlib/tests/device_tests/test_msg_getpublickey_curve.py index 5acf7e956..f2130eed0 100644 --- a/trezorlib/tests/device_tests/test_msg_getpublickey_curve.py +++ b/trezorlib/tests/device_tests/test_msg_getpublickey_curve.py @@ -16,8 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * -import trezorlib.ckd_public as bip32 +from .common import TrezorTest from trezorlib.client import CallException diff --git a/trezorlib/tests/device_tests/test_msg_signtx_bcash.py b/trezorlib/tests/device_tests/test_msg_signtx_bcash.py index f397d5b6a..9a6d32974 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx_bcash.py +++ b/trezorlib/tests/device_tests/test_msg_signtx_bcash.py @@ -15,10 +15,13 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * +import pytest +from binascii import hexlify, unhexlify + +from .common import TrezorTest +from ..support.ckd_public import deserialize from trezorlib import coins from trezorlib import messages as proto -from trezorlib.ckd_public import deserialize from trezorlib.client import CallException TxApiBcash = coins.tx_api['Bcash'] @@ -256,7 +259,6 @@ class TestMsgSigntxBch(TrezorTest): attack_ctr = 0 def attack_processor(req, msg): - import sys global attack_ctr if req.details.tx_hash is not None: diff --git a/trezorlib/tests/device_tests/test_msg_signtx_bitcoin_gold.py b/trezorlib/tests/device_tests/test_msg_signtx_bitcoin_gold.py index 99b5082c0..846f029de 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx_bitcoin_gold.py +++ b/trezorlib/tests/device_tests/test_msg_signtx_bitcoin_gold.py @@ -16,10 +16,13 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * +import pytest +from binascii import hexlify, unhexlify + +from .common import TrezorTest +from ..support.ckd_public import deserialize from trezorlib import coins from trezorlib import messages as proto -from trezorlib.ckd_public import deserialize from trezorlib.client import CallException TxApiBitcoinGold = coins.tx_api["Bitcoin Gold"] @@ -129,7 +132,6 @@ class TestMsgSigntxBitcoinGold(TrezorTest): attack_ctr = 0 def attack_processor(req, msg): - import sys global attack_ctr if req.details.tx_hash is not None: diff --git a/trezorlib/tests/device_tests/test_msg_signtx_segwit.py b/trezorlib/tests/device_tests/test_msg_signtx_segwit.py index 65136c3a3..9064a6d2e 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx_segwit.py +++ b/trezorlib/tests/device_tests/test_msg_signtx_segwit.py @@ -15,11 +15,12 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * +from binascii import hexlify, unhexlify +from .common import TrezorTest +from ..support.ckd_public import deserialize from trezorlib import coins from trezorlib import messages as proto -from trezorlib.ckd_public import deserialize from trezorlib.client import CallException TxApiTestnet = coins.tx_api["Testnet"] @@ -186,7 +187,6 @@ class TestMsgSigntxSegwit(TrezorTest): run_attack = True def attack_processor(req, msg): - import sys global run_attack if req.details.tx_hash is not None: diff --git a/trezorlib/tests/device_tests/test_msg_signtx_segwit_native.py b/trezorlib/tests/device_tests/test_msg_signtx_segwit_native.py index f82f93ff8..18bf14447 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx_segwit_native.py +++ b/trezorlib/tests/device_tests/test_msg_signtx_segwit_native.py @@ -15,11 +15,13 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * +from binascii import hexlify, unhexlify +from .common import TrezorTest +from ..support.ckd_public import deserialize from trezorlib import coins from trezorlib import messages as proto -from trezorlib.ckd_public import deserialize +from trezorlib.client import CallException TxApiTestnet = coins.tx_api['Testnet'] diff --git a/trezorlib/tests/device_tests/test_multisig.py b/trezorlib/tests/device_tests/test_multisig.py index 4316a9a71..24446835e 100644 --- a/trezorlib/tests/device_tests/test_multisig.py +++ b/trezorlib/tests/device_tests/test_multisig.py @@ -16,14 +16,13 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from __future__ import print_function +from binascii import hexlify, unhexlify -from .common import * +from .common import TrezorTest +from ..support import ckd_public as bip32 from trezorlib import messages as proto -import trezorlib.ckd_public as bip32 from trezorlib.client import CallException - TXHASH_c6091a = unhexlify('c6091adf4c0c23982a35899a6e58ae11e703eacd7954f588ed4b9cdefc4dba52') diff --git a/trezorlib/tests/device_tests/test_multisig_change.py b/trezorlib/tests/device_tests/test_multisig_change.py index 2d2d1c4dd..0086d353c 100644 --- a/trezorlib/tests/device_tests/test_multisig_change.py +++ b/trezorlib/tests/device_tests/test_multisig_change.py @@ -16,9 +16,11 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from .common import * +from binascii import hexlify, unhexlify + +from .common import TrezorTest +from ..support import ckd_public as bip32 from trezorlib import messages as proto -import trezorlib.ckd_public as bip32 from trezorlib.coins import tx_api diff --git a/trezorlib/tests/unit_tests/test_ckd_public.py b/trezorlib/tests/unit_tests/test_ckd_public.py index d7f36fb3d..b6488a773 100644 --- a/trezorlib/tests/unit_tests/test_ckd_public.py +++ b/trezorlib/tests/unit_tests/test_ckd_public.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . -from trezorlib import ckd_public +from ..support import ckd_public def test_ckd_public():