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

pull/33777/head
Martin Hjelmare 2020-04-07 12:36:40 +02:00 committed by GitHub
parent 643848cac4
commit cb98d62968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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}