@@ -26,12 +26,12 @@ async def test_user_flow_minimum_fields(hass, pyscript_bypass_setup):
2626 """Test user config flow with minimum fields."""
2727 # test form shows
2828 result = await hass .config_entries .flow .async_init (DOMAIN , context = {"source" : SOURCE_USER })
29- assert result ["type" ] == data_entry_flow .RESULT_TYPE_FORM
29+ assert result ["type" ] == data_entry_flow .FlowResultType . FORM
3030 assert result ["step_id" ] == "user"
3131
3232 result = await hass .config_entries .flow .async_configure (result ["flow_id" ], user_input = {})
3333
34- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
34+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
3535 assert CONF_ALLOW_ALL_IMPORTS in result ["data" ]
3636 assert CONF_HASS_IS_GLOBAL in result ["data" ]
3737 assert not result ["data" ][CONF_ALLOW_ALL_IMPORTS ]
@@ -44,14 +44,14 @@ async def test_user_flow_all_fields(hass, pyscript_bypass_setup):
4444 # test form shows
4545 result = await hass .config_entries .flow .async_init (DOMAIN , context = {"source" : SOURCE_USER })
4646
47- assert result ["type" ] == data_entry_flow .RESULT_TYPE_FORM
47+ assert result ["type" ] == data_entry_flow .FlowResultType . FORM
4848 assert result ["step_id" ] == "user"
4949
5050 result = await hass .config_entries .flow .async_configure (
5151 result ["flow_id" ], user_input = {CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True }
5252 )
5353
54- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
54+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
5555 assert CONF_ALLOW_ALL_IMPORTS in result ["data" ]
5656 assert result ["data" ][CONF_ALLOW_ALL_IMPORTS ]
5757 assert result ["data" ][CONF_HASS_IS_GLOBAL ]
@@ -66,15 +66,15 @@ async def test_user_already_configured(hass, pyscript_bypass_setup):
6666 data = {CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True },
6767 )
6868
69- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
69+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
7070
7171 result = await hass .config_entries .flow .async_init (
7272 DOMAIN ,
7373 context = {"source" : SOURCE_USER },
7474 data = {CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True },
7575 )
7676
77- assert result ["type" ] == data_entry_flow .RESULT_TYPE_ABORT
77+ assert result ["type" ] == data_entry_flow .FlowResultType . ABORT
7878 assert result ["reason" ] == "single_instance_allowed"
7979
8080
@@ -85,7 +85,7 @@ async def test_import_flow(hass, pyscript_bypass_setup):
8585 DOMAIN , context = {"source" : SOURCE_IMPORT }, data = PYSCRIPT_SCHEMA ({})
8686 )
8787
88- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
88+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
8989
9090
9191@pytest .mark .asyncio
@@ -95,15 +95,15 @@ async def test_import_flow_update_allow_all_imports(hass, pyscript_bypass_setup)
9595 DOMAIN , context = {"source" : SOURCE_IMPORT }, data = PYSCRIPT_SCHEMA ({})
9696 )
9797
98- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
98+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
9999
100100 result = await hass .config_entries .flow .async_init (
101101 DOMAIN ,
102102 context = {"source" : SOURCE_IMPORT },
103103 data = {CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True },
104104 )
105105
106- assert result ["type" ] == data_entry_flow .RESULT_TYPE_ABORT
106+ assert result ["type" ] == data_entry_flow .FlowResultType . ABORT
107107 assert result ["reason" ] == "updated_entry"
108108
109109
@@ -114,13 +114,13 @@ async def test_import_flow_update_apps_from_none(hass, pyscript_bypass_setup):
114114 DOMAIN , context = {"source" : SOURCE_IMPORT }, data = PYSCRIPT_SCHEMA ({})
115115 )
116116
117- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
117+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
118118
119119 result = await hass .config_entries .flow .async_init (
120120 DOMAIN , context = {"source" : SOURCE_IMPORT }, data = {"apps" : {"test_app" : {"param" : 1 }}}
121121 )
122122
123- assert result ["type" ] == data_entry_flow .RESULT_TYPE_ABORT
123+ assert result ["type" ] == data_entry_flow .FlowResultType . ABORT
124124 assert result ["reason" ] == "updated_entry"
125125
126126
@@ -131,11 +131,11 @@ async def test_import_flow_update_apps_to_none(hass, pyscript_bypass_setup):
131131 DOMAIN , context = {"source" : SOURCE_IMPORT }, data = PYSCRIPT_SCHEMA ({"apps" : {"test_app" : {"param" : 1 }}})
132132 )
133133
134- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
134+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
135135
136136 result = await hass .config_entries .flow .async_init (DOMAIN , context = {"source" : SOURCE_IMPORT }, data = {})
137137
138- assert result ["type" ] == data_entry_flow .RESULT_TYPE_ABORT
138+ assert result ["type" ] == data_entry_flow .FlowResultType . ABORT
139139 assert result ["reason" ] == "updated_entry"
140140
141141
@@ -146,13 +146,13 @@ async def test_import_flow_no_update(hass, pyscript_bypass_setup):
146146 DOMAIN , context = {"source" : SOURCE_IMPORT }, data = PYSCRIPT_SCHEMA ({})
147147 )
148148
149- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
149+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
150150
151151 result = await hass .config_entries .flow .async_init (
152152 DOMAIN , context = {"source" : SOURCE_IMPORT }, data = PYSCRIPT_SCHEMA ({})
153153 )
154154
155- assert result ["type" ] == data_entry_flow .RESULT_TYPE_ABORT
155+ assert result ["type" ] == data_entry_flow .FlowResultType . ABORT
156156 assert result ["reason" ] == "already_configured"
157157
158158
@@ -165,13 +165,13 @@ async def test_import_flow_update_user(hass, pyscript_bypass_setup):
165165 data = PYSCRIPT_SCHEMA ({CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True }),
166166 )
167167
168- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
168+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
169169
170170 result = await hass .config_entries .flow .async_init (
171171 DOMAIN , context = {"source" : SOURCE_IMPORT }, data = {"apps" : {"test_app" : {"param" : 1 }}}
172172 )
173173
174- assert result ["type" ] == data_entry_flow .RESULT_TYPE_ABORT
174+ assert result ["type" ] == data_entry_flow .FlowResultType . ABORT
175175 assert result ["reason" ] == "updated_entry"
176176
177177 assert hass .config_entries .async_entries (DOMAIN )[0 ].data == {
@@ -190,13 +190,13 @@ async def test_import_flow_update_import(hass, pyscript_bypass_setup):
190190 data = PYSCRIPT_SCHEMA ({CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True }),
191191 )
192192
193- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
193+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
194194
195195 result = await hass .config_entries .flow .async_init (
196196 DOMAIN , context = {"source" : SOURCE_IMPORT }, data = {"apps" : {"test_app" : {"param" : 1 }}}
197197 )
198198
199- assert result ["type" ] == data_entry_flow .RESULT_TYPE_ABORT
199+ assert result ["type" ] == data_entry_flow .FlowResultType . ABORT
200200 assert result ["reason" ] == "updated_entry"
201201
202202 assert hass .config_entries .async_entries (DOMAIN )[0 ].data == {"apps" : {"test_app" : {"param" : 1 }}}
@@ -211,17 +211,17 @@ async def test_options_flow_import(hass, pyscript_bypass_setup):
211211 data = PYSCRIPT_SCHEMA ({CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True }),
212212 )
213213 await hass .async_block_till_done ()
214- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
214+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
215215 entry = result ["result" ]
216216
217217 result = await hass .config_entries .options .async_init (entry .entry_id , data = None )
218218
219- assert result ["type" ] == data_entry_flow .RESULT_TYPE_FORM
219+ assert result ["type" ] == data_entry_flow .FlowResultType . FORM
220220 assert result ["step_id" ] == "no_ui_configuration_allowed"
221221
222222 result = await hass .config_entries .options .async_configure (result ["flow_id" ], user_input = None )
223223
224- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
224+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
225225 assert result ["title" ] == ""
226226
227227
@@ -234,20 +234,20 @@ async def test_options_flow_user_change(hass, pyscript_bypass_setup):
234234 data = PYSCRIPT_SCHEMA ({CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True }),
235235 )
236236 await hass .async_block_till_done ()
237- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
237+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
238238 entry = result ["result" ]
239239
240240 result = await hass .config_entries .options .async_init (entry .entry_id )
241241
242- assert result ["type" ] == data_entry_flow .RESULT_TYPE_FORM
242+ assert result ["type" ] == data_entry_flow .FlowResultType . FORM
243243 assert result ["step_id" ] == "init"
244244
245245 result = await hass .config_entries .options .async_configure (
246246 result ["flow_id" ], user_input = {CONF_ALLOW_ALL_IMPORTS : False , CONF_HASS_IS_GLOBAL : False }
247247 )
248248 await hass .async_block_till_done ()
249249
250- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
250+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
251251 assert result ["title" ] == ""
252252
253253 assert entry .data [CONF_ALLOW_ALL_IMPORTS ] is False
@@ -263,24 +263,24 @@ async def test_options_flow_user_no_change(hass, pyscript_bypass_setup):
263263 data = PYSCRIPT_SCHEMA ({CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True }),
264264 )
265265 await hass .async_block_till_done ()
266- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
266+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
267267 entry = result ["result" ]
268268
269269 result = await hass .config_entries .options .async_init (entry .entry_id )
270270
271- assert result ["type" ] == data_entry_flow .RESULT_TYPE_FORM
271+ assert result ["type" ] == data_entry_flow .FlowResultType . FORM
272272 assert result ["step_id" ] == "init"
273273
274274 result = await hass .config_entries .options .async_configure (
275275 result ["flow_id" ], user_input = {CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True }
276276 )
277277
278- assert result ["type" ] == data_entry_flow .RESULT_TYPE_FORM
278+ assert result ["type" ] == data_entry_flow .FlowResultType . FORM
279279 assert result ["step_id" ] == "no_update"
280280
281281 result = await hass .config_entries .options .async_configure (result ["flow_id" ], user_input = None )
282282
283- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
283+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
284284 assert result ["title" ] == ""
285285
286286
@@ -296,7 +296,7 @@ async def test_config_entry_reload(hass):
296296 data = PYSCRIPT_SCHEMA ({CONF_ALLOW_ALL_IMPORTS : True , CONF_HASS_IS_GLOBAL : True }),
297297 )
298298 await hass .async_block_till_done ()
299- assert result ["type" ] == data_entry_flow .RESULT_TYPE_CREATE_ENTRY
299+ assert result ["type" ] == data_entry_flow .FlowResultType . CREATE_ENTRY
300300 entry = result ["result" ]
301301 listeners = hass .bus .async_listeners ()
302302 await hass .config_entries .async_reload (entry .entry_id )
0 commit comments