Ensure github tests add config entry before updating it (#110430)

This commit is contained in:
J. Nick Koston
2024-02-12 22:00:44 -06:00
committed by GitHub
parent 704ad67917
commit 0e1cdc1f79
4 changed files with 20 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ async def setup_github_integration(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
aioclient_mock: AiohttpClientMocker,
add_entry_to_hass: bool = True,
) -> None:
"""Mock setting up the integration."""
headers = json.loads(load_fixture("base_headers.json", DOMAIN))
@@ -41,7 +42,8 @@ async def setup_github_integration(
json=json.loads(load_fixture("graphql.json", DOMAIN)),
headers=headers,
)
mock_config_entry.add_to_hass(hass)
if add_entry_to_hass:
mock_config_entry.add_to_hass(hass)
setup_result = await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()