Add and use HTTP_FORBIDDEN constant (#33839)

This commit is contained in:
springstan authored and GitHub committed 2020-04-09 17:41:17 +02:00
1 parent 70ee9d7f26
commit bc26be3c11
15 files changed
+60 -37

No files matched your search

+2 -1
View File
@@ -12,6 +12,7 @@ from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_BILLION,
CONCENTRATION_PARTS_PER_MILLION,
HTTP_FORBIDDEN,
HTTP_INTERNAL_SERVER_ERROR,
TEMP_CELSIUS,
UNIT_PERCENTAGE,
@@ -71,7 +72,7 @@ async def test_setup_permanent_error(hass, aioclient_mock):
"""Expected failures caused by permanent errors in API response."""
fake_async_add_entities = MagicMock()
errors = [400, 401, 403]
errors = [400, 401, HTTP_FORBIDDEN]
for error in errors:
aioclient_mock.get(re.compile("api.foobot.io/v2/owner/.*"), status=error)
result = await foobot.async_setup_platform(