def test_check_config_ok(hassio_env, hass, aioclient_mock): """Check Config that is okay.""" assert (yield from async_setup_component(hass, 'hassio', {})) aioclient_mock.post("http://127.0.0.1/homeassistant/check", json={'result': 'ok'}) assert (yield from async_check_config(hass)) is None
def test_check_config_ok(hassio_env, hass, aioclient_mock): """Check Config that is okay.""" assert (yield from async_setup_component(hass, 'hassio', {})) aioclient_mock.post( "http://127.0.0.1/homeassistant/check", json={'result': 'ok'}) assert (yield from async_check_config(hass)) is None
def test_check_config_fail(hassio_env, hass, aioclient_mock): """Check Config that is wrong.""" assert (yield from async_setup_component(hass, 'hassio', {})) aioclient_mock.post( "http://127.0.0.1/homeassistant/check", json={ 'result': 'error', 'message': "Error"}) assert (yield from async_check_config(hass)) == "Error"
def test_check_config_fail(hassio_env, hass, aioclient_mock): """Check Config that is wrong.""" assert (yield from async_setup_component(hass, 'hassio', {})) aioclient_mock.post( "http://127.0.0.1/homeassistant/check", json={ 'result': 'error', 'message': "Error"}) assert (yield from async_check_config(hass)) == "Error"