Ejemplo n.º 1
0
 def test_DoorOther(self):
     data = {}
     data['device'] = 'device'
     data['port'] = 'port'
     listeners = ['a', 'b']
     door = ConvertGarageDoorState()
     results, new_data, new_listeners = door.step('ste', data, listeners)
     self.assertEqual(results, -1)
     self.assertEqual(new_data['units'], 'invalid')
Ejemplo n.º 2
0
 def test_DoorOther(self):
     data = {}
     data['device'] = 'device'
     data['port'] = 'port'
     listeners = ['a', 'b']
     door = ConvertGarageDoorState()
     results, new_data, new_listeners = door.step('ste', data, listeners)
     self.assertEqual(results, -1)
     self.assertEqual(new_data['units'], 'invalid')
Ejemplo n.º 3
0
 def test_DoorClosed(self):
     data = {}
     data['device'] = 'device'
     data['port'] = 'port'
     data['at'] = datetime(2013, 1, 2, 3, 4, 5)
     listeners = ['a', 'b']
     door = ConvertGarageDoorState()
     results, new_data, new_listeners = door.step(False, data, listeners)
     self.assertEqual(results, '0')
     self.assertEqual(new_data['units'], 'open')
Ejemplo n.º 4
0
 def test_DoorClosed(self):
     data = {}
     data['device'] = 'device'
     data['port'] = 'port'
     data['at'] = datetime(2013, 1, 2, 3, 4, 5)
     listeners = ['a', 'b']
     door = ConvertGarageDoorState()
     results, new_data, new_listeners = door.step(False, data, listeners)
     self.assertEqual(results, '0')
     self.assertEqual(new_data['units'], 'open')