@@ -24,13 +24,13 @@ async def test_user_flow_success(hass: HomeAssistant) -> None:
2424 result = await hass .config_entries .flow .async_init (
2525 datadog .DOMAIN , context = {"source" : SOURCE_USER }
2626 )
27- assert result ["type" ] == FlowResultType .FORM
27+ assert result ["type" ] is FlowResultType .FORM
2828
2929 result2 = await hass .config_entries .flow .async_configure (
3030 result ["flow_id" ], user_input = MOCK_CONFIG
3131 )
3232 assert result2 ["title" ] == f"Datadog { MOCK_CONFIG ['host' ]} "
33- assert result2 ["type" ] == FlowResultType .CREATE_ENTRY
33+ assert result2 ["type" ] is FlowResultType .CREATE_ENTRY
3434 assert result2 ["data" ] == MOCK_DATA
3535 assert result2 ["options" ] == MOCK_OPTIONS
3636
@@ -48,7 +48,7 @@ async def test_user_flow_retry_after_connection_fail(hass: HomeAssistant) -> Non
4848 result2 = await hass .config_entries .flow .async_configure (
4949 result ["flow_id" ], user_input = MOCK_CONFIG
5050 )
51- assert result2 ["type" ] == FlowResultType .FORM
51+ assert result2 ["type" ] is FlowResultType .FORM
5252 assert result2 ["errors" ] == {"base" : "cannot_connect" }
5353
5454 with patch (
@@ -57,7 +57,7 @@ async def test_user_flow_retry_after_connection_fail(hass: HomeAssistant) -> Non
5757 result3 = await hass .config_entries .flow .async_configure (
5858 result ["flow_id" ], user_input = MOCK_CONFIG
5959 )
60- assert result3 ["type" ] == FlowResultType .CREATE_ENTRY
60+ assert result3 ["type" ] is FlowResultType .CREATE_ENTRY
6161 assert result3 ["data" ] == MOCK_DATA
6262 assert result3 ["options" ] == MOCK_OPTIONS
6363
@@ -104,13 +104,13 @@ async def test_options_flow_cannot_connect(hass: HomeAssistant) -> None:
104104 side_effect = OSError ("connection failed" ),
105105 ):
106106 result = await hass .config_entries .options .async_init (mock_entry .entry_id )
107- assert result ["type" ] == FlowResultType .FORM
107+ assert result ["type" ] is FlowResultType .FORM
108108
109109 result2 = await hass .config_entries .options .async_configure (
110110 result ["flow_id" ], user_input = MOCK_OPTIONS
111111 )
112112
113- assert result2 ["type" ] == FlowResultType .FORM
113+ assert result2 ["type" ] is FlowResultType .FORM
114114 assert result2 ["errors" ] == {"base" : "cannot_connect" }
115115
116116 with patch (
@@ -119,7 +119,7 @@ async def test_options_flow_cannot_connect(hass: HomeAssistant) -> None:
119119 result3 = await hass .config_entries .options .async_configure (
120120 result ["flow_id" ], user_input = MOCK_OPTIONS
121121 )
122- assert result3 ["type" ] == FlowResultType .CREATE_ENTRY
122+ assert result3 ["type" ] is FlowResultType .CREATE_ENTRY
123123 assert result3 ["data" ] == MOCK_OPTIONS
124124
125125
@@ -141,7 +141,7 @@ async def test_import_flow(
141141 data = MOCK_CONFIG ,
142142 )
143143
144- assert result ["type" ] == FlowResultType .CREATE_ENTRY
144+ assert result ["type" ] is FlowResultType .CREATE_ENTRY
145145 assert result ["data" ] == MOCK_DATA
146146 assert result ["options" ] == MOCK_OPTIONS
147147
@@ -200,11 +200,11 @@ async def test_options_flow(hass: HomeAssistant) -> None:
200200 side_effect = OSError ,
201201 ):
202202 result = await hass .config_entries .options .async_init (mock_entry .entry_id )
203- assert result ["type" ] == FlowResultType .FORM
203+ assert result ["type" ] is FlowResultType .FORM
204204 result2 = await hass .config_entries .options .async_configure (
205205 result ["flow_id" ], user_input = new_options
206206 )
207- assert result2 ["type" ] == FlowResultType .FORM
207+ assert result2 ["type" ] is FlowResultType .FORM
208208 assert result2 ["errors" ] == {"base" : "cannot_connect" }
209209
210210 # ValueError Case
@@ -213,11 +213,11 @@ async def test_options_flow(hass: HomeAssistant) -> None:
213213 side_effect = ValueError ,
214214 ):
215215 result = await hass .config_entries .options .async_init (mock_entry .entry_id )
216- assert result ["type" ] == FlowResultType .FORM
216+ assert result ["type" ] is FlowResultType .FORM
217217 result2 = await hass .config_entries .options .async_configure (
218218 result ["flow_id" ], user_input = new_options
219219 )
220- assert result2 ["type" ] == FlowResultType .FORM
220+ assert result2 ["type" ] is FlowResultType .FORM
221221 assert result2 ["errors" ] == {"base" : "cannot_connect" }
222222
223223 # Success Case
@@ -231,7 +231,7 @@ async def test_options_flow(hass: HomeAssistant) -> None:
231231 result ["flow_id" ], user_input = new_options
232232 )
233233
234- assert result ["type" ] == FlowResultType .CREATE_ENTRY
234+ assert result ["type" ] is FlowResultType .CREATE_ENTRY
235235 assert result ["data" ] == new_options
236236 mock_instance .increment .assert_called_once_with ("connection_test" )
237237
@@ -253,5 +253,5 @@ async def test_import_flow_abort_already_configured_service(
253253 data = MOCK_CONFIG ,
254254 )
255255
256- assert result ["type" ] == FlowResultType .ABORT
256+ assert result ["type" ] is FlowResultType .ABORT
257257 assert result ["reason" ] == "already_configured"
0 commit comments