def test_constructor(self):
     try:
         Mailbox('name', BluetoothMailboxClient())
         Mailbox('name', BluetoothMailboxClient(), lambda: True)
         Mailbox('name', BluetoothMailboxClient(), lambda: True,
                 lambda: False)
     except:
         self.fail()
Exemple #2
0
 def test_constructor(self):
     try:
         TextMailbox('name', BluetoothMailboxClient())
     except:
         self.fail()
Exemple #3
0
 def test_wait_new(self):
     box = TextMailbox('name', BluetoothMailboxClient())
     self.assertIsInstance(box.wait_new(), str)
     self.assertEqual(box.wait_new(), "")
Exemple #4
0
 def test_wait(self):
     box = TextMailbox('name', BluetoothMailboxClient())
     self.assertIsNone(box.wait())
Exemple #5
0
 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'))
Exemple #10
0
 def test_close(self):
     client = BluetoothMailboxClient()
     self.assertIsNone(client.close())
Exemple #11
0
 def test_connect(self):
     client = BluetoothMailboxClient()
     self.assertIsNone(client.connect('brick'))
Exemple #12
0
 def test_wait_new(self):
     box = NumericMailbox('name', BluetoothMailboxClient())
     self.assertIsInstance(box.wait_new(), int)
     self.assertEqual(box.wait_new(), 0)
Exemple #13
0
 def test_send(self):
     box = NumericMailbox('name', BluetoothMailboxClient())
     self.assertIsNone(box.send(1.5, 'brick'))
     self.assertIsNone(box.send(15, 'brick'))