Add one more test

pull/25418/head
Tobias Haase 2019-08-02 07:19:20 +02:00
parent 6be42c8fb4
commit 92d2a4b7d3
1 changed files with 16 additions and 0 deletions

View File

@ -45,6 +45,22 @@ def mock_get_uuid():
yield mock
@asyncio.coroutine
def test_new_version_shows_entity_startup(hass, mock_get_uuid, mock_get_newest_version):
"""Test if new entity is created if it is unavailable at first."""
mock_get_uuid.return_value = MOCK_HUUID
mock_get_newest_version.return_value = mock_coro((NEW_VERSION, RELEASE_NOTES))
res = yield from async_setup_component(hass, updater.DOMAIN, {updater.DOMAIN: {}})
assert res, "Updater failed to set up"
yield from hass.async_block_till_done()
assert hass.states.is_state("binary_sensor.updater", "unavailable")
assert "newest_version" not in hass.states.get("binary_sensor.updater").attributes
assert "release_notes" not in hass.states.get("binary_sensor.updater").attributes
@asyncio.coroutine
def test_new_version_shows_entity_true(hass, mock_get_uuid, mock_get_newest_version):
"""Test if new entity is created if new version is available."""