Exemplo n.º 1
0
 def test_control_port(self):
     client = fake.FakeMFiClient()
     port = client.get_port(label='Relay Control')
     self.assertEqual(0.0, port.output)
     port.control(True)
     self.assertEqual(0.0, port.output)
     port = client.get_port(label='Relay Control')
     self.assertEqual(1.0, port.output)
     port.control(False)
     port = client.get_port(label='Relay Control')
     self.assertEqual(0.0, port.output)
Exemplo n.º 2
0
 def test_control_port(self):
     client = fake.FakeMFiClient()
     port = client.get_port(label='Relay Control')
     self.assertEqual(0.0, port.output)
     port.control(True)
     self.assertEqual(0.0, port.output)
     port = client.get_port(label='Relay Control')
     self.assertEqual(1.0, port.output)
     port.control(False)
     port = client.get_port(label='Relay Control')
     self.assertEqual(0.0, port.output)
Exemplo n.º 3
0
 def test_get_port(self):
     client = fake.FakeMFiClient()
     port = client.get_port(label='Relay Control')
     self.assertEqual('Output 12v', port.model)
     self.assertEqual('Relay Control', port.label)
     self.assertEqual('5650b1f29e1141bc88ed29f9', port.ident)
     self.assertTrue(isinstance(port.data, dict))
Exemplo n.º 4
0
 def test_get_port(self):
     client = fake.FakeMFiClient()
     port = client.get_port(label='Relay Control')
     self.assertEqual('Output 12v', port.model)
     self.assertEqual('Relay Control', port.label)
     self.assertEqual('5650b1f29e1141bc88ed29f9', port.ident)
     self.assertTrue(isinstance(port.data, dict))