Patch gdacs entry setup in config flow tests (#33776)

This commit is contained in:
Martin Hjelmare
2020-04-07 12:36:40 +02:00
committed by GitHub
parent 643848cac4
commit cb98d62968

View File

@@ -1,6 +1,9 @@
"""Define tests for the GDACS config flow.""" """Define tests for the GDACS config flow."""
from datetime import timedelta from datetime import timedelta
from asynctest import patch
import pytest
from homeassistant import data_entry_flow from homeassistant import data_entry_flow
from homeassistant.components.gdacs import CONF_CATEGORIES, DOMAIN from homeassistant.components.gdacs import CONF_CATEGORIES, DOMAIN
from homeassistant.const import ( 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): async def test_duplicate_error(hass, config_entry):
"""Test that errors are shown when duplicates are added.""" """Test that errors are shown when duplicates are added."""
conf = {CONF_LATITUDE: -41.2, CONF_LONGITUDE: 174.7, CONF_RADIUS: 25} conf = {CONF_LATITUDE: -41.2, CONF_LONGITUDE: 174.7, CONF_RADIUS: 25}