mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-08 22:40:59 +00:00
Refactored module structure
This commit is contained in:
parent
4530dc3684
commit
c692f60782
@ -1,26 +1,32 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import config
|
import config
|
||||||
|
|
||||||
from bitkeylib.client import BitkeyClient
|
from trezorlib.client import TrezorClient
|
||||||
from bitkeylib.debuglink import DebugLink
|
from trezorlib.debuglink import DebugLink
|
||||||
from bitkeylib import proto
|
from trezorlib import proto
|
||||||
|
|
||||||
class BitkeyTest(unittest.TestCase):
|
class TrezorTest(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.debug_transport = config.DEBUG_TRANSPORT(*config.DEBUG_TRANSPORT_ARGS)
|
self.debug_transport = config.DEBUG_TRANSPORT(*config.DEBUG_TRANSPORT_ARGS)
|
||||||
self.transport = config.TRANSPORT(*config.TRANSPORT_ARGS)
|
self.transport = config.TRANSPORT(*config.TRANSPORT_ARGS)
|
||||||
self.bitkey = BitkeyClient(self.transport, DebugLink(self.debug_transport), debug=True)
|
self.client = TrezorClient(self.transport, DebugLink(self.debug_transport), debug=True)
|
||||||
|
|
||||||
self.bitkey.setup_debuglink(button=True, pin_correct=True)
|
self.mnemonic1 = 'panda tree planet type cinnamon digital always essence grocery poor tree slot'
|
||||||
|
self.mnemonic2 = 'glory vanish past debate cricket extra receive spring scatter rebound bat expect'
|
||||||
|
self.pin1 = '1234'
|
||||||
|
self.pin2 = '43211'
|
||||||
|
|
||||||
self.bitkey.load_device(
|
self.client.setup_debuglink(button=True, pin_correct=True)
|
||||||
seed='soda country ghost glove unusual dose blouse cope bless medal block car',
|
|
||||||
pin='1234')
|
self.client.load_device(
|
||||||
|
seed=self.mnemonic1,
|
||||||
|
pin=self.pin1)
|
||||||
|
|
||||||
|
self.client.apply_settings(label='unit testing', coin_shortcut='BTC', language='english')
|
||||||
|
|
||||||
print "Setup finished"
|
print "Setup finished"
|
||||||
print "--------------"
|
print "--------------"
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.bitkey.init_device()
|
|
||||||
self.debug_transport.close()
|
self.debug_transport.close()
|
||||||
self.transport.close()
|
self.transport.close()
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import sys
|
import sys
|
||||||
sys.path = ['../',] + sys.path
|
sys.path = ['../',] + sys.path
|
||||||
|
|
||||||
from bitkeylib.transport_pipe import PipeTransport
|
from trezorlib.transport_pipe import PipeTransport
|
||||||
from bitkeylib.transport_hid import HidTransport
|
from trezorlib.transport_hid import HidTransport
|
||||||
from bitkeylib.transport_socket import SocketTransportClient
|
from trezorlib.transport_socket import SocketTransportClient
|
||||||
|
|
||||||
TRANSPORT = PipeTransport
|
TRANSPORT = PipeTransport
|
||||||
TRANSPORT_ARGS = ('../../trezor-emu/pipe.trezor', False)
|
TRANSPORT_ARGS = ('../../trezor-emu/pipe.trezor', False)
|
||||||
|
Loading…
Reference in New Issue
Block a user