Test we abort if already configured.
(
hass: HomeAssistant,
_mock_setup_entry: None,
snapshots: SnapshotFixture,
check_report_issue: None,
)
| 304 | |
| 305 | |
| 306 | async def test_already_configured( |
| 307 | hass: HomeAssistant, |
| 308 | _mock_setup_entry: None, |
| 309 | snapshots: SnapshotFixture, |
| 310 | check_report_issue: None, |
| 311 | ) -> None: |
| 312 | """Test we abort if already configured.""" |
| 313 | config_entry = create_config_entry() |
| 314 | config_entry.add_to_hass(hass) |
| 315 | |
| 316 | result = await hass.config_entries.flow.async_init( |
| 317 | DOMAIN, |
| 318 | context={"source": config_entries.SOURCE_USER}, |
| 319 | ) |
| 320 | await hass.async_block_till_done() |
| 321 | |
| 322 | assert result["type"] == FlowResultType.ABORT |
| 323 | snapshots.assert_match( |
| 324 | safe_json_dumps(recursive_remove_key( |
| 325 | result, ("flow_id", "minor_version"))), |
| 326 | "config_flow/test_already_configured.json", |
| 327 | ) |
| 328 | |
| 329 | |
| 330 | async def test_options_flow(hass: HomeAssistant, setup_integration: Generator) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…