mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fix flaky srp energy test (#56536)
This commit is contained in:
parent
a5d405700c
commit
39aaa383b3
@ -93,13 +93,21 @@ async def test_form_unknown_exception(hass):
|
|||||||
|
|
||||||
async def test_config(hass):
|
async def test_config(hass):
|
||||||
"""Test handling of configuration imported."""
|
"""Test handling of configuration imported."""
|
||||||
with patch("homeassistant.components.srp_energy.config_flow.SrpEnergyClient"):
|
with patch(
|
||||||
|
"homeassistant.components.srp_energy.config_flow.SrpEnergyClient"
|
||||||
|
), patch(
|
||||||
|
"homeassistant.components.srp_energy.async_setup_entry",
|
||||||
|
return_value=True,
|
||||||
|
) as mock_setup_entry:
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
SRP_ENERGY_DOMAIN,
|
SRP_ENERGY_DOMAIN,
|
||||||
context={"source": config_entries.SOURCE_IMPORT},
|
context={"source": config_entries.SOURCE_IMPORT},
|
||||||
data=ENTRY_CONFIG,
|
data=ENTRY_CONFIG,
|
||||||
)
|
)
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
assert len(mock_setup_entry.mock_calls) == 1
|
||||||
|
|
||||||
|
|
||||||
async def test_integration_already_configured(hass):
|
async def test_integration_already_configured(hass):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user