mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Remove unused fixture from elmax tests (#118684)
This commit is contained in:
parent
8772a59f5c
commit
d5eebb202b
@ -1,7 +1,8 @@
|
||||
"""Configuration for Elmax tests."""
|
||||
|
||||
from collections.abc import Generator
|
||||
import json
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
from elmax_api.constants import (
|
||||
BASE_URL,
|
||||
@ -29,7 +30,7 @@ MOCK_DIRECT_BASE_URI = (
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def httpx_mock_cloud_fixture(requests_mock):
|
||||
def httpx_mock_cloud_fixture() -> Generator[respx.MockRouter, None, None]:
|
||||
"""Configure httpx fixture for cloud API communication."""
|
||||
with respx.mock(base_url=BASE_URL, assert_all_called=False) as respx_mock:
|
||||
# Mock Login POST.
|
||||
@ -56,7 +57,7 @@ def httpx_mock_cloud_fixture(requests_mock):
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def httpx_mock_direct_fixture(requests_mock):
|
||||
def httpx_mock_direct_fixture() -> Generator[respx.MockRouter, None, None]:
|
||||
"""Configure httpx fixture for direct Panel-API communication."""
|
||||
with respx.mock(
|
||||
base_url=MOCK_DIRECT_BASE_URI, assert_all_called=False
|
||||
@ -79,7 +80,7 @@ def httpx_mock_direct_fixture(requests_mock):
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def elmax_mock_direct_cert(requests_mock):
|
||||
def elmax_mock_direct_cert() -> Generator[AsyncMock, None, None]:
|
||||
"""Patch elmax library to return a specific PEM for SSL communication."""
|
||||
with patch(
|
||||
"elmax_api.http.GenericElmax.retrieve_server_certificate",
|
||||
|
Loading…
x
Reference in New Issue
Block a user