def test_constructor(self): try: Mailbox('name', BluetoothMailboxClient()) Mailbox('name', BluetoothMailboxClient(), lambda: True) Mailbox('name', BluetoothMailboxClient(), lambda: True, lambda: False) except: self.fail()
def test_constructor(self): try: TextMailbox('name', BluetoothMailboxClient()) except: self.fail()
def test_wait_new(self): box = TextMailbox('name', BluetoothMailboxClient()) self.assertIsInstance(box.wait_new(), str) self.assertEqual(box.wait_new(), "")
def test_wait(self): box = TextMailbox('name', BluetoothMailboxClient()) self.assertIsNone(box.wait())
def test_send(self): box = TextMailbox('name', BluetoothMailboxClient()) self.assertIsNone(box.send("test", 'brick'))
def test_wait_new(self): box = Mailbox('name', BluetoothMailboxClient()) self.assertIsNotNone(box.wait_new())
def test_wait_new(self): box = LogicMailbox('name', BluetoothMailboxClient()) self.assertIsInstance(box.wait_new(), bool) self.assertFalse(box.wait_new())
def test_read(self): box = Mailbox('name', BluetoothMailboxClient()) self.assertIsNotNone(box.read())
def test_send(self): box = LogicMailbox('name', BluetoothMailboxClient()) self.assertIsNone(box.send(False, 'brick'))
def test_close(self): client = BluetoothMailboxClient() self.assertIsNone(client.close())
def test_connect(self): client = BluetoothMailboxClient() self.assertIsNone(client.connect('brick'))
def test_wait_new(self): box = NumericMailbox('name', BluetoothMailboxClient()) self.assertIsInstance(box.wait_new(), int) self.assertEqual(box.wait_new(), 0)
def test_send(self): box = NumericMailbox('name', BluetoothMailboxClient()) self.assertIsNone(box.send(1.5, 'brick')) self.assertIsNone(box.send(15, 'brick'))