1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-10 15:30:55 +00:00

allow running tests without debuglink

This commit is contained in:
Pavol Rusnak 2016-11-12 15:06:32 +01:00
parent b494b2d3a0
commit 77bfef3a25
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 9 additions and 9 deletions

View File

@ -1,16 +1,19 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
from trezorlib.client import TrezorDebugClient from trezorlib.client import TrezorClient, TrezorDebugClient
from trezorlib.tx_api import TxApiBitcoin from trezorlib.tx_api import TxApiBitcoin
import config import config
class TrezorTest(unittest.TestCase): class TrezorTest(unittest.TestCase):
def setUp(self): def setUp(self):
self.debug_transport = config.DEBUG_TRANSPORT(*config.DEBUG_TRANSPORT_ARGS, **config.DEBUG_TRANSPORT_KWARGS) transport = config.TRANSPORT(*config.TRANSPORT_ARGS, **config.TRANSPORT_KWARGS)
self.transport = config.TRANSPORT(*config.TRANSPORT_ARGS, **config.TRANSPORT_KWARGS) if hasattr(config, 'DEBUG_TRANSPORT'):
self.client = TrezorDebugClient(self.transport) debug_transport = config.DEBUG_TRANSPORT(*config.DEBUG_TRANSPORT_ARGS, **config.DEBUG_TRANSPORT_KWARGS)
self.client.set_debuglink(self.debug_transport) self.client = TrezorDebugClient(transport)
self.client.set_debuglink(debug_transport)
else:
self.client = TrezorClient(transport)
self.client.set_tx_api(TxApiBitcoin) self.client.set_tx_api(TxApiBitcoin)
# self.client.set_buttonwait(3) # self.client.set_buttonwait(3)

View File

@ -38,8 +38,5 @@ elif pipe_exists('/tmp/pipe.trezor.to'):
elif True: elif True:
print('Using Emulator (v2=udp)') print('Using Emulator (v2=udp)')
TRANSPORT = UdpTransport TRANSPORT = UdpTransport
TRANSPORT_ARGS = ('127.0.0.1:21324') TRANSPORT_ARGS = ('', )
TRANSPORT_KWARGS = {} TRANSPORT_KWARGS = {}
DEBUG_TRANSPORT = UdpTransport
DEBUG_TRANSPORT_ARGS = ('127.0.0.1:21324')
DEBUG_TRANSPORT_KWARGS = {}