Ejemplo n.º 1
0
 def test_constructor(self):
     try:
         Mailbox('name', BluetoothMailboxClient())
         Mailbox('name', BluetoothMailboxClient(), lambda: True)
         Mailbox('name', BluetoothMailboxClient(), lambda: True,
                 lambda: False)
     except:
         self.fail()
Ejemplo n.º 2
0
 def test_constructor(self):
     try:
         TextMailbox('name', BluetoothMailboxClient())
     except:
         self.fail()
Ejemplo n.º 3
0
 def test_wait_new(self):
     box = TextMailbox('name', BluetoothMailboxClient())
     self.assertIsInstance(box.wait_new(), str)
     self.assertEqual(box.wait_new(), "")
Ejemplo n.º 4
0
 def test_wait(self):
     box = TextMailbox('name', BluetoothMailboxClient())
     self.assertIsNone(box.wait())
Ejemplo n.º 5
0
 def test_send(self):
     box = TextMailbox('name', BluetoothMailboxClient())
     self.assertIsNone(box.send("test", 'brick'))
Ejemplo n.º 6
0
 def test_wait_new(self):
     box = Mailbox('name', BluetoothMailboxClient())
     self.assertIsNotNone(box.wait_new())
Ejemplo n.º 7
0
 def test_wait_new(self):
     box = LogicMailbox('name', BluetoothMailboxClient())
     self.assertIsInstance(box.wait_new(), bool)
     self.assertFalse(box.wait_new())
Ejemplo n.º 8
0
 def test_read(self):
     box = Mailbox('name', BluetoothMailboxClient())
     self.assertIsNotNone(box.read())
Ejemplo n.º 9
0
 def test_send(self):
     box = LogicMailbox('name', BluetoothMailboxClient())
     self.assertIsNone(box.send(False, 'brick'))
Ejemplo n.º 10
0
 def test_close(self):
     client = BluetoothMailboxClient()
     self.assertIsNone(client.close())
Ejemplo n.º 11
0
 def test_connect(self):
     client = BluetoothMailboxClient()
     self.assertIsNone(client.connect('brick'))
Ejemplo n.º 12
0
 def test_wait_new(self):
     box = NumericMailbox('name', BluetoothMailboxClient())
     self.assertIsInstance(box.wait_new(), int)
     self.assertEqual(box.wait_new(), 0)
Ejemplo n.º 13
0
 def test_send(self):
     box = NumericMailbox('name', BluetoothMailboxClient())
     self.assertIsNone(box.send(1.5, 'brick'))
     self.assertIsNone(box.send(15, 'brick'))