From bfc2995cf84ad3791e8277067e0ff127dc1a52d3 Mon Sep 17 00:00:00 2001 From: Chris Talkington Date: Mon, 28 Jun 2021 03:40:51 -0500 Subject: [PATCH] Update cloudflare test helpers (#52235) --- tests/components/cloudflare/__init__.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/components/cloudflare/__init__.py b/tests/components/cloudflare/__init__.py index 0e4e07b91cc..f2eaccab470 100644 --- a/tests/components/cloudflare/__init__.py +++ b/tests/components/cloudflare/__init__.py @@ -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