Add return code to integration application credentials in config flow (#71986)

* Add return code to integration application credentials in config flow

* Update google tests to use new return code

* Update spotify test for no auth configured

* Add translation for oauth2_missing_credentials

* Add new return code to yolink

* Update homeassistant/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Allen Porter
2022-05-18 06:30:57 -07:00
committed by GitHub
co-authored by Martin Hjelmare Franck Nijhof
parent 23cb5cfd3f
commit 26ee289be3
6 changed files with 20 additions and 5 deletions
+2 -2
View File
@@ -327,7 +327,7 @@ async def test_missing_configuration(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result.get("type") == "abort"
assert result.get("reason") == "missing_configuration"
assert result.get("reason") == "missing_credentials"
@pytest.mark.parametrize("google_config", [None])
@@ -342,7 +342,7 @@ async def test_missing_configuration_yaml_empty(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result.get("type") == "abort"
assert result.get("reason") == "missing_configuration"
assert result.get("reason") == "missing_credentials"
async def test_wrong_configuration(
+2 -2
View File
@@ -31,14 +31,14 @@ async def test_abort_if_no_configuration(hass):
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["reason"] == "missing_configuration"
assert result["reason"] == "missing_credentials"
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_ZEROCONF}, data=BLANK_ZEROCONF_INFO
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["reason"] == "missing_configuration"
assert result["reason"] == "missing_credentials"
async def test_zeroconf_abort_if_existing_entry(hass):
+1 -1
View File
@@ -25,7 +25,7 @@ async def test_abort_if_no_configuration(hass):
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["reason"] == "missing_configuration"
assert result["reason"] == "missing_credentials"
async def test_abort_if_existing_entry(hass: HomeAssistant):