refactor: Refactoring most of the project
Some checks failed
🧪 Integration Testing / 🔧 Test Integration (2025.9.4, 3.13) (push) Failing after 24s
Some checks failed
🧪 Integration Testing / 🔧 Test Integration (2025.9.4, 3.13) (push) Failing after 24s
Signed-off-by: Rafal Zielinski <sq4ind@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import pytest
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.config_entries import ConfigEntry, SOURCE_USER
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
|
||||
|
||||
from custom_components.adguard_hub import async_setup_entry, async_unload_entry
|
||||
@@ -12,9 +12,10 @@ from custom_components.adguard_hub.const import DOMAIN
|
||||
|
||||
@pytest.fixture
|
||||
def mock_config_entry():
|
||||
"""Mock config entry."""
|
||||
"""Mock config entry compatible with HA 2025.9.4."""
|
||||
return ConfigEntry(
|
||||
version=1,
|
||||
minor_version=1,
|
||||
domain=DOMAIN,
|
||||
title="Test AdGuard",
|
||||
data={
|
||||
@@ -23,8 +24,12 @@ def mock_config_entry():
|
||||
CONF_USERNAME: "admin",
|
||||
CONF_PASSWORD: "password",
|
||||
},
|
||||
source="user",
|
||||
options={},
|
||||
source=SOURCE_USER,
|
||||
entry_id="test_entry_id",
|
||||
unique_id="192.168.1.100:3000",
|
||||
discovery_keys=set(),
|
||||
subentries_data={},
|
||||
)
|
||||
|
||||
|
||||
@@ -145,11 +150,11 @@ async def test_api_error_handling(mock_api):
|
||||
await mock_api.get_clients()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_services_registration(hass: HomeAssistant):
|
||||
def test_services_registration(hass: HomeAssistant):
|
||||
"""Test that services are properly registered."""
|
||||
from custom_components.adguard_hub.services import AdGuardControlHubServices
|
||||
|
||||
# Create services without running inside an existing event loop
|
||||
services = AdGuardControlHubServices(hass)
|
||||
services.register_services()
|
||||
|
||||
|
Reference in New Issue
Block a user