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())
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())
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())
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())