Skip to content

Commit

Permalink
Use MockConfigEntry in unifi tests (#117238)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed May 11, 2024
1 parent daef625 commit 90a50c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions tests/components/unifi/test_device_tracker.py
Expand Up @@ -5,7 +5,6 @@
from aiounifi.models.message import MessageKey
from freezegun.api import FrozenDateTimeFactory, freeze_time

from homeassistant import config_entries
from homeassistant.components.device_tracker import DOMAIN as TRACKER_DOMAIN
from homeassistant.components.unifi.const import (
CONF_BLOCK_CLIENT,
Expand All @@ -26,7 +25,7 @@

from .test_hub import ENTRY_CONFIG, setup_unifi_integration

from tests.common import async_fire_time_changed
from tests.common import MockConfigEntry, async_fire_time_changed
from tests.test_util.aiohttp import AiohttpClientMocker


Expand Down Expand Up @@ -959,11 +958,8 @@ async def test_restoring_client(
"mac": "00:00:00:00:00:03",
}

config_entry = config_entries.ConfigEntry(
version=1,
minor_version=1,
config_entry = MockConfigEntry(
domain=UNIFI_DOMAIN,
title="Mock Title",
data=ENTRY_CONFIG,
source="test",
options={},
Expand Down
8 changes: 2 additions & 6 deletions tests/components/unifi/test_switch.py
Expand Up @@ -6,7 +6,6 @@
from aiounifi.models.message import MessageKey
import pytest

from homeassistant import config_entries
from homeassistant.components.switch import (
DOMAIN as SWITCH_DOMAIN,
SERVICE_TURN_OFF,
Expand Down Expand Up @@ -38,7 +37,7 @@

from .test_hub import CONTROLLER_HOST, ENTRY_CONFIG, SITE, setup_unifi_integration

from tests.common import async_fire_time_changed
from tests.common import MockConfigEntry, async_fire_time_changed
from tests.test_util.aiohttp import AiohttpClientMocker

CLIENT_1 = {
Expand Down Expand Up @@ -1628,11 +1627,8 @@ async def test_updating_unique_id(
],
}

config_entry = config_entries.ConfigEntry(
version=1,
minor_version=1,
config_entry = MockConfigEntry(
domain=UNIFI_DOMAIN,
title="Mock Title",
data=ENTRY_CONFIG,
source="test",
options={},
Expand Down

0 comments on commit 90a50c1

Please sign in to comment.