mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-24 12:29:08 +00:00
Create issue for detected DNS server problem (#3578)
* Create issue for detected DNS server problem * Validate behavior on restart as well * tls:// not supported, remove check * Move DNS server checks into resolution checks * Revert all changes to plugins.dns * Run DNS server checks if affected * Mock aiodns query during all checks tests
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Test check."""
|
||||
# pylint: disable=import-error,protected-access
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -11,6 +11,19 @@ from supervisor.resolution.const import IssueType
|
||||
from supervisor.resolution.validate import get_valid_modules
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def fixture_mock_dns_query():
|
||||
"""Mock aiodns query."""
|
||||
with patch(
|
||||
"supervisor.resolution.checks.dns_server_failure.DNSResolver.query",
|
||||
new_callable=AsyncMock,
|
||||
), patch(
|
||||
"supervisor.resolution.checks.dns_server_ipv6_error.DNSResolver.query",
|
||||
new_callable=AsyncMock,
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
async def test_check_setup(coresys: CoreSys):
|
||||
"""Test check for setup."""
|
||||
coresys.core.state = CoreState.SETUP
|
||||
|
||||
Reference in New Issue
Block a user