From cb98d629680f772c820c8f296a37a82743bc4869 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Tue, 7 Apr 2020 12:36:40 +0200 Subject: [PATCH] Patch gdacs entry setup in config flow tests (#33776) --- tests/components/gdacs/test_config_flow.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/components/gdacs/test_config_flow.py b/tests/components/gdacs/test_config_flow.py index f04f8158862..c3c5f5609c4 100644 --- a/tests/components/gdacs/test_config_flow.py +++ b/tests/components/gdacs/test_config_flow.py @@ -1,6 +1,9 @@ """Define tests for the GDACS config flow.""" from datetime import timedelta +from asynctest import patch +import pytest + from homeassistant import data_entry_flow from homeassistant.components.gdacs import CONF_CATEGORIES, DOMAIN from homeassistant.const import ( @@ -11,6 +14,13 @@ from homeassistant.const import ( ) +@pytest.fixture(name="gdacs_setup", autouse=True) +def gdacs_setup_fixture(): + """Mock gdacs entry setup.""" + with patch("homeassistant.components.gdacs.async_setup_entry", return_value=True): + yield + + async def test_duplicate_error(hass, config_entry): """Test that errors are shown when duplicates are added.""" conf = {CONF_LATITUDE: -41.2, CONF_LONGITUDE: 174.7, CONF_RADIUS: 25}