Basic structure of unit tests
parent
05a15eaf7d
commit
b6106fa681
@ -0,0 +1,10 @@
|
||||
import sys
|
||||
sys.path = ['../',] + sys.path
|
||||
|
||||
from bitkeylib.transport_pipe import PipeTransport
|
||||
|
||||
TRANSPORT = PipeTransport
|
||||
TRANSPORT_ARGS = ('../../bitkey-python/device.socket', False)
|
||||
|
||||
DEBUG_TRANSPORT = PipeTransport
|
||||
DEBUG_TRANSPORT_ARGS = ('../../bitkey-python/device.socket.debug', False)
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
python -m unittest discover
|
@ -0,0 +1,19 @@
|
||||
import unittest
|
||||
import config
|
||||
|
||||
from bitkeylib.client import BitkeyClient
|
||||
from bitkeylib import proto
|
||||
|
||||
class TestBasic(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.debuglink = config.DEBUG_TRANSPORT(*config.DEBUG_TRANSPORT_ARGS)
|
||||
self.transport = config.TRANSPORT(*config.TRANSPORT_ARGS)
|
||||
self.bitkey = BitkeyClient(self.transport, self.debuglink)
|
||||
|
||||
def tearDown(self):
|
||||
self.debuglink.close()
|
||||
self.transport.close()
|
||||
|
||||
def test_basic(self):
|
||||
self.assertEqual(self.bitkey.call(proto.Ping(message='ahoj!')), proto.Success(message='ahoj!'))
|
Loading…
Reference in New Issue