2013-01-14 13:44:31 +00:00
|
|
|
import unittest
|
|
|
|
import config
|
|
|
|
|
|
|
|
from bitkeylib.client import BitkeyClient
|
|
|
|
from bitkeylib.debuglink import DebugLink
|
|
|
|
from bitkeylib import proto
|
|
|
|
|
|
|
|
class BitkeyTest(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
|
|
self.debug_transport = config.DEBUG_TRANSPORT(*config.DEBUG_TRANSPORT_ARGS)
|
|
|
|
self.transport = config.TRANSPORT(*config.TRANSPORT_ARGS)
|
2013-04-15 17:57:36 +00:00
|
|
|
self.bitkey = BitkeyClient(self.transport, DebugLink(self.debug_transport), debug=True)
|
2013-01-14 13:44:31 +00:00
|
|
|
|
2013-09-01 00:47:49 +00:00
|
|
|
self.bitkey.setup_debuglink(button=True, pin_correct=True)
|
2013-01-14 13:44:31 +00:00
|
|
|
|
2013-09-01 00:47:49 +00:00
|
|
|
self.bitkey.load_device(
|
2013-04-15 17:57:36 +00:00
|
|
|
seed='beyond neighbor scratch swirl embarrass doll cause also stick softly physical nice',
|
2013-09-01 00:47:49 +00:00
|
|
|
pin='1234')
|
2013-01-14 13:44:31 +00:00
|
|
|
|
|
|
|
print "Setup finished"
|
|
|
|
print "--------------"
|
|
|
|
|
|
|
|
def tearDown(self):
|
2013-04-05 15:13:29 +00:00
|
|
|
self.bitkey.init_device()
|
2013-01-14 13:44:31 +00:00
|
|
|
self.debug_transport.close()
|
2013-04-15 17:57:36 +00:00
|
|
|
self.transport.close()
|