Update cloudflare test helpers (#52235)

This commit is contained in:
Chris Talkington 2021-06-28 03:40:51 -05:00 committed by GitHub
parent e14480599b
commit bfc2995cf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,13 +58,21 @@ async def init_integration(
*,
data: dict = ENTRY_CONFIG,
options: dict = ENTRY_OPTIONS,
unique_id: str = MOCK_ZONE,
skip_setup: bool = False,
) -> MockConfigEntry:
"""Set up the Cloudflare integration in Home Assistant."""
entry = MockConfigEntry(domain=DOMAIN, data=data, options=options)
entry = MockConfigEntry(
domain=DOMAIN,
data=data,
options=options,
unique_id=unique_id,
)
entry.add_to_hass(hass)
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
if not skip_setup:
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
return entry