1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 05:28:40 +00:00
trezor-firmware/tests/common.py

37 lines
1.3 KiB
Python
Raw Normal View History

import unittest
import config
2013-09-13 03:28:56 +00:00
from trezorlib.client import TrezorClient
from trezorlib.debuglink import DebugLink
2013-09-13 03:28:56 +00:00
class TrezorTest(unittest.TestCase):
def setUp(self):
self.debug_transport = config.DEBUG_TRANSPORT(*config.DEBUG_TRANSPORT_ARGS)
self.transport = config.TRANSPORT(*config.TRANSPORT_ARGS)
2013-09-13 03:28:56 +00:00
self.client = TrezorClient(self.transport, DebugLink(self.debug_transport), debug=True)
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)
self.client.wipe_device()
2014-01-12 15:16:07 +00:00
self.client.load_device_by_mnemonic(
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
print "Setup finished"
print "--------------"
def tearDown(self):
self.debug_transport.close()
self.transport.close()