From 733a4e979cafa1a3d3b4aab71fe720220570074a Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 20 Jan 2014 13:21:49 +0100 Subject: [PATCH] adapt config.py to new api --- .gitignore | 1 + tests/config.py | 30 +++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 0d20b64..f3df5d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.pyc +*.bin diff --git a/tests/config.py b/tests/config.py index 02aa190..56963ad 100644 --- a/tests/config.py +++ b/tests/config.py @@ -5,22 +5,38 @@ from trezorlib.transport_pipe import PipeTransport from trezorlib.transport_hid import HidTransport from trezorlib.transport_socket import SocketTransportClient -use_pipe = True -if use_pipe: +use_real = True +use_pipe = False + +if use_real: + + devices = HidTransport.enumerate() + TRANSPORT = HidTransport + TRANSPORT_ARGS = (devices[0], ) + TRANSPORT_KWARGS = {'debug_link': False} + + DEBUG_TRANSPORT = HidTransport + DEBUG_TRANSPORT_ARGS = (devices[0], ) + DEBUG_TRANSPORT_KWARGS = {'debug_link': True} + +elif use_pipe: TRANSPORT = PipeTransport TRANSPORT_ARGS = ('../../trezor-emu/pipe.trezor', False) + TRANSPORT_KWARGS = {} DEBUG_TRANSPORT = PipeTransport DEBUG_TRANSPORT_ARGS = ('../../trezor-emu/pipe.trezor_debug', False) + DEBUG_TRANSPORT_KWARGS = {} else: + devices = HidTransport.enumerate() TRANSPORT = HidTransport - TRANSPORT_ARGS = ('0x10c4:0xea80:000868D3', False) + TRANSPORT_ARGS = (devices[0], ) + TRANSPORT_KWARGS = {'debug_link': False} DEBUG_TRANSPORT = SocketTransportClient - DEBUG_TRANSPORT_ARGS = ('trezor.bo:2000', False) - -#DEBUG_TRANSPORT = SocketTransportClient -#DEBUG_TRANSPORT_ARGS = ('trezor.dyn:2000', False) + DEBUG_TRANSPORT_ARGS = ('trezor.bo:2000', ) +# DEBUG_TRANSPORT_ARGS = ('trezor.dyn:2000') + DEBUG_TRANSPORT_KWARGS = {}