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:
parent
b494b2d3a0
commit
77bfef3a25
@ -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)
|
||||
|
||||
|
@ -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 = {}
|
||||
|
Loading…
Reference in New Issue
Block a user