Skip to content

Commit

Permalink
Update test_demo.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pvizeli committed Nov 15, 2017
1 parent e9848a1 commit 123afaa
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions tests/components/light/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,36 +79,3 @@ def test_turn_off_without_entity_id(self):
light.turn_off(self.hass)
self.hass.block_till_done()
self.assertFalse(light.is_on(self.hass, ENTITY_LIGHT))


@asyncio.coroutine
def test_restore_state(hass):
"""Test state gets restored."""
mock_component(hass, 'recorder')
hass.state = CoreState.starting
hass.data[DATA_RESTORE_CACHE] = {
'light.bed_light': State('light.bed_light', 'on', {
'brightness': 'value-brightness',
'color_temp': 'value-color_temp',
'rgb_color': 'value-rgb_color',
'xy_color': 'value-xy_color',
'white_value': 'value-white_value',
'effect': 'value-effect',
}),
}

yield from async_setup_component(hass, 'light', {
'light': {
'platform': 'demo',
}})

state = hass.states.get('light.bed_light')
assert state is not None
assert state.entity_id == 'light.bed_light'
assert state.state == 'on'
assert state.attributes.get('brightness') == 'value-brightness'
assert state.attributes.get('color_temp') == 'value-color_temp'
assert state.attributes.get('rgb_color') == 'value-rgb_color'
assert state.attributes.get('xy_color') == 'value-xy_color'
assert state.attributes.get('white_value') == 'value-white_value'
assert state.attributes.get('effect') == 'value-effect'

0 comments on commit 123afaa

Please sign in to comment.