2013-01-14 13:44:31 +00:00
|
|
|
import unittest
|
|
|
|
import config
|
|
|
|
|
2013-09-13 03:28:56 +00:00
|
|
|
from trezorlib.client import TrezorClient
|
|
|
|
from trezorlib.debuglink import DebugLink
|
2013-01-14 13:44:31 +00:00
|
|
|
|
2013-09-13 03:28:56 +00:00
|
|
|
class TrezorTest(unittest.TestCase):
|
2013-01-14 13:44:31 +00:00
|
|
|
def setUp(self):
|
2014-02-04 15:12:52 +00:00
|
|
|
self.debug_transport = config.DEBUG_TRANSPORT(*config.DEBUG_TRANSPORT_ARGS, **config.DEBUG_TRANSPORT_KWARGS)
|
|
|
|
self.transport = config.TRANSPORT(*config.TRANSPORT_ARGS, **config.TRANSPORT_KWARGS)
|
2013-09-13 03:28:56 +00:00
|
|
|
self.client = TrezorClient(self.transport, DebugLink(self.debug_transport), debug=True)
|
2014-02-03 23:32:10 +00:00
|
|
|
# self.client = TrezorClient(self.transport, debug=False)
|
2013-09-13 03:28:56 +00:00
|
|
|
|
2014-01-12 15:16:07 +00:00
|
|
|
self.mnemonic1 = 'alcohol woman abuse must during monitor noble actual mixed trade anger aisle'
|
|
|
|
self.mnemonic2 = 'owner little vague addict embark decide pink prosper true fork panda embody mixture exchange choose canoe electric jewel'
|
2013-09-13 03:28:56 +00:00
|
|
|
self.pin1 = '1234'
|
|
|
|
self.pin2 = '43211'
|
|
|
|
|
|
|
|
self.client.setup_debuglink(button=True, pin_correct=True)
|
2013-01-14 13:44:31 +00:00
|
|
|
|
2014-02-01 12:39:21 +00:00
|
|
|
self.client.wipe_device()
|
2014-01-12 15:16:07 +00:00
|
|
|
self.client.load_device_by_mnemonic(
|
2013-12-30 22:35:20 +00:00
|
|
|
mnemonic=self.mnemonic1,
|
2014-01-12 15:16:07 +00:00
|
|
|
pin=self.pin1,
|
|
|
|
passphrase_protection=False,
|
|
|
|
label='test',
|
|
|
|
language='english',
|
|
|
|
)
|
2013-09-13 03:28:56 +00:00
|
|
|
|
2014-01-12 15:16:07 +00:00
|
|
|
# self.client.apply_settings(label='unit testing', coin_shortcut='BTC', language='english')
|
2013-09-13 03:28:56 +00:00
|
|
|
|
2013-01-14 13:44:31 +00:00
|
|
|
print "Setup finished"
|
|
|
|
print "--------------"
|
|
|
|
|
|
|
|
def tearDown(self):
|
|
|
|
self.debug_transport.close()
|
2013-04-15 17:57:36 +00:00
|
|
|
self.transport.close()
|