Use FlowResultType enum in Tuya tests (#74596)

pull/74612/head
Franck Nijhof 2022-07-07 12:31:19 +02:00 committed by GitHub
parent 19f33d205c
commit 4fcf8280f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -84,7 +84,7 @@ async def test_user_flow(
DOMAIN, context={"source": config_entries.SOURCE_USER} DOMAIN, context={"source": config_entries.SOURCE_USER}
) )
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "user" assert result["step_id"] == "user"
tuya().connect = MagicMock(side_effect=side_effects) tuya().connect = MagicMock(side_effect=side_effects)
@ -95,7 +95,7 @@ async def test_user_flow(
country = [country for country in TUYA_COUNTRIES if country.name == MOCK_COUNTRY][0] country = [country for country in TUYA_COUNTRIES if country.name == MOCK_COUNTRY][0]
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
assert result["title"] == MOCK_USERNAME assert result["title"] == MOCK_USERNAME
assert result["data"][CONF_ACCESS_ID] == MOCK_ACCESS_ID assert result["data"][CONF_ACCESS_ID] == MOCK_ACCESS_ID
assert result["data"][CONF_ACCESS_SECRET] == MOCK_ACCESS_SECRET assert result["data"][CONF_ACCESS_SECRET] == MOCK_ACCESS_SECRET
@ -115,7 +115,7 @@ async def test_error_on_invalid_credentials(hass, tuya):
DOMAIN, context={"source": config_entries.SOURCE_USER} DOMAIN, context={"source": config_entries.SOURCE_USER}
) )
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["step_id"] == "user" assert result["step_id"] == "user"
tuya().connect = MagicMock(return_value=RESPONSE_ERROR) tuya().connect = MagicMock(return_value=RESPONSE_ERROR)