Use common strings in Awair (#41313)

* awair use common strings

* Use common strings: 'auth' to invalid_access_token

* Use reauth successful ref

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Dave TandMartin Hjelmare authored and GitHub committed 2020-10-07 15:17:10 +02:00
1 parent 306ee30574
commit d3bc4efa89
3 files changed
+11 -11

No files matched your search

+3 -3
View File
@@ -31,7 +31,7 @@ async def test_invalid_access_token(hass):
DOMAIN, context={"source": SOURCE_USER}, data=CONFIG
)
assert result["errors"] == {CONF_ACCESS_TOKEN: "auth"}
assert result["errors"] == {CONF_ACCESS_TOKEN: "invalid_access_token"}
async def test_unexpected_api_error(hass):
@@ -78,7 +78,7 @@ async def test_no_devices_error(hass):
)
assert result["type"] == "abort"
assert result["reason"] == "no_devices"
assert result["reason"] == "no_devices_found"
async def test_import(hass):
@@ -169,7 +169,7 @@ async def test_reauth(hass):
data=CONFIG,
)
assert result["errors"] == {CONF_ACCESS_TOKEN: "auth"}
assert result["errors"] == {CONF_ACCESS_TOKEN: "invalid_access_token"}
with patch("python_awair.AwairClient.query", side_effect=AwairError()):
result = await hass.config_entries.flow.async_init(