예제 #1
0
 def test_done_tilt_close_state(self):
     device = DeviceMock('TestDevice')
     blind = Blind('Test', 0, 0, device, [], [])
     Close(blind).do()
     self.assertEqual(1, device.close_counter)
     self.assertEqual(State.CLOSED, device.stats())
     tilt = Tilt(blind)
     self.assertFalse(tilt.done())
예제 #2
0
 def test_done_tilt_different_tilt_state(self):
     device = DeviceMock('TestDevice')
     blind = Blind('Test', 0, 0, device, [], [])
     Tilt(blind, 45).do()
     self.assertEqual(1, device.tilt_counter)
     self.assertEqual(State.TILT, device.stats())
     tilt = Tilt(blind)
     self.assertFalse(tilt.done())
예제 #3
0
 def test_done_tilt_open_state(self):
     device = DeviceMock('TestDevice')
     blind = Blind('Test', 0, 0, device, [], [])
     Open(blind).do()
     self.assertEqual(1, device.open_counter)
     self.assertEqual(State.OPEN, device.stats())
     tilt = Tilt(blind)
     self.assertFalse(tilt.done())
예제 #4
0
 def test_done_tilt_moved_state(self):
     device = DeviceMock('TestDevice')
     blind = Blind('Test', 0, 0, device, [], [])
     device.move(50)
     tilt = Tilt(blind)
     self.assertFalse(tilt.done())