diff --git a/tests/common.py b/tests/common.py index 29190dbe3d..e1e0453fe4 100644 --- a/tests/common.py +++ b/tests/common.py @@ -1,16 +1,19 @@ from __future__ import print_function import unittest -from trezorlib.client import TrezorDebugClient +from trezorlib.client import TrezorClient, TrezorDebugClient from trezorlib.tx_api import TxApiBitcoin import config class TrezorTest(unittest.TestCase): def setUp(self): - self.debug_transport = config.DEBUG_TRANSPORT(*config.DEBUG_TRANSPORT_ARGS, **config.DEBUG_TRANSPORT_KWARGS) - self.transport = config.TRANSPORT(*config.TRANSPORT_ARGS, **config.TRANSPORT_KWARGS) - self.client = TrezorDebugClient(self.transport) - self.client.set_debuglink(self.debug_transport) + transport = config.TRANSPORT(*config.TRANSPORT_ARGS, **config.TRANSPORT_KWARGS) + if hasattr(config, 'DEBUG_TRANSPORT'): + debug_transport = config.DEBUG_TRANSPORT(*config.DEBUG_TRANSPORT_ARGS, **config.DEBUG_TRANSPORT_KWARGS) + self.client = TrezorDebugClient(transport) + self.client.set_debuglink(debug_transport) + else: + self.client = TrezorClient(transport) self.client.set_tx_api(TxApiBitcoin) # self.client.set_buttonwait(3) diff --git a/tests/config.py b/tests/config.py index 4829a07903..1936180e13 100644 --- a/tests/config.py +++ b/tests/config.py @@ -38,8 +38,5 @@ elif pipe_exists('/tmp/pipe.trezor.to'): elif True: print('Using Emulator (v2=udp)') TRANSPORT = UdpTransport - TRANSPORT_ARGS = ('127.0.0.1:21324') + TRANSPORT_ARGS = ('', ) TRANSPORT_KWARGS = {} - DEBUG_TRANSPORT = UdpTransport - DEBUG_TRANSPORT_ARGS = ('127.0.0.1:21324') - DEBUG_TRANSPORT_KWARGS = {}