def test__shut_down(self): backlight = BacklightMock() self.assertEqual(backlight.state, None) state = LEDState('quit') backlight.state_changed(state) self.assertEqual(backlight.state.name, state.name) self.assertEqual(backlight.state.rgb, state.rgb)
def test__turn_off(self): backlight = BacklightMock() self.assertEqual(backlight.state, None) state = LEDState('clear') backlight.state_changed(state) self.assertEqual(backlight.state.name, state.name) self.assertEqual(backlight.state.rgb, state.rgb)
def test__set_occupied(self): backlight = BacklightMock() self.assertEqual(backlight.state, None) state = LEDState('rgb', (255, 0, 0)) backlight.state_changed(state) self.assertEqual(backlight.state.name, state.name) self.assertEqual(backlight.state.rgb, state.rgb)
def test__shut_down(self): state = LEDState('quit') self.port.state_changed(state) self.assertEqual(self.adapter.state.name, state.name) self.assertEqual(self.adapter.state.rgb, state.rgb)
def test__turn_off(self): state = LEDState('clear') self.port.state_changed(state) self.assertEqual(self.adapter.state.name, state.name) self.assertEqual(self.adapter.state.rgb, state.rgb)
def test__set_occupied(self): state = LEDState('rgb', (0, 255, 0)) self.port.state_changed(state) self.assertEqual(self.adapter.state.name, state.name) self.assertEqual(self.adapter.state.rgb, state.rgb)