Use HTTP_NOT_FOUND constant (#33835)

This commit is contained in:
springstan 2020-04-09 00:57:47 +02:00 committed by GitHub
parent ac9429988b
commit 9a40d5b7ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 98 additions and 78 deletions

View file

@ -17,6 +17,7 @@ from homeassistant.const import (
CONF_SCAN_INTERVAL,
CONF_TOKEN,
CONF_USERNAME,
HTTP_NOT_FOUND,
)
from tests.common import MockConfigEntry, mock_coro
@ -81,7 +82,7 @@ async def test_form_cannot_connect(hass):
with patch(
"homeassistant.components.tesla.config_flow.TeslaAPI.connect",
side_effect=TeslaException(code=404),
side_effect=TeslaException(code=HTTP_NOT_FOUND),
):
result2 = await hass.config_entries.flow.async_configure(
result["flow_id"],
@ -147,10 +148,7 @@ async def test_option_flow(hass):
user_input={CONF_SCAN_INTERVAL: 350, CONF_WAKE_ON_START: True},
)
assert result["type"] == "create_entry"
assert result["data"] == {
CONF_SCAN_INTERVAL: 350,
CONF_WAKE_ON_START: True,
}
assert result["data"] == {CONF_SCAN_INTERVAL: 350, CONF_WAKE_ON_START: True}
async def test_option_flow_defaults(hass):