Fix race in gardena_bluetooth config flow tests (#111042)
parent
5b00703ef7
commit
145c6163a4
|
@ -1,17 +1,17 @@
|
|||
# serializer version: 1
|
||||
# name: test_bluetooth
|
||||
FlowResultSnapshot({
|
||||
'data_schema': None,
|
||||
'description_placeholders': dict({
|
||||
'name': 'Gardena Water Computer',
|
||||
'context': dict({
|
||||
'confirm_only': True,
|
||||
'source': 'bluetooth',
|
||||
'title_placeholders': dict({
|
||||
'name': 'Gardena Water Computer',
|
||||
}),
|
||||
'unique_id': '00000000-0000-0000-0000-000000000001',
|
||||
}),
|
||||
'errors': None,
|
||||
'flow_id': <ANY>,
|
||||
'handler': 'gardena_bluetooth',
|
||||
'last_step': None,
|
||||
'preview': None,
|
||||
'step_id': 'confirm',
|
||||
'type': <FlowResultType.FORM: 'form'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_bluetooth.1
|
||||
|
|
|
@ -100,13 +100,12 @@ async def test_bluetooth(
|
|||
) -> None:
|
||||
"""Test bluetooth device discovery."""
|
||||
|
||||
# Inject the service info will trigger the flow to start
|
||||
inject_bluetooth_service_info(hass, WATER_TIMER_SERVICE_INFO)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
result = next(iter(hass.config_entries.flow.async_progress_by_handler(DOMAIN)))
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_BLUETOOTH},
|
||||
data=WATER_TIMER_SERVICE_INFO,
|
||||
)
|
||||
assert result == snapshot
|
||||
|
||||
result = await hass.config_entries.flow.async_configure(
|
||||
|
|
Loading…
Reference in New Issue