mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add config flow for cloudflare (#41167)
* add config flow for cloudflare * Create const.py * work on flow. * remove const. * lint. * Apply suggestions from code review Co-authored-by: J. Nick Koston <nick@koston.org> * Update config_flows.py * Update homeassistant/components/cloudflare/strings.json * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Update strings.json * Apply suggestions from code review * Update __init__.py * Update __init__.py Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
28
tests/components/cloudflare/conftest.py
Normal file
28
tests/components/cloudflare/conftest.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Define fixtures available for all tests."""
|
||||
from pytest import fixture
|
||||
|
||||
from . import _get_mock_cfupdate
|
||||
|
||||
from tests.async_mock import patch
|
||||
|
||||
|
||||
@fixture
|
||||
def cfupdate(hass):
|
||||
"""Mock the CloudflareUpdater for easier testing."""
|
||||
mock_cfupdate = _get_mock_cfupdate()
|
||||
with patch(
|
||||
"homeassistant.components.cloudflare.CloudflareUpdater",
|
||||
return_value=mock_cfupdate,
|
||||
) as mock_api:
|
||||
yield mock_api
|
||||
|
||||
|
||||
@fixture
|
||||
def cfupdate_flow(hass):
|
||||
"""Mock the CloudflareUpdater for easier config flow testing."""
|
||||
mock_cfupdate = _get_mock_cfupdate()
|
||||
with patch(
|
||||
"homeassistant.components.cloudflare.config_flow.CloudflareUpdater",
|
||||
return_value=mock_cfupdate,
|
||||
) as mock_api:
|
||||
yield mock_api
|
||||
Reference in New Issue
Block a user