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
|
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)
|
||||||
|
|
||||||
|
@ -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 = {}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user