mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 12:30:31 +00:00
Speedtestdotnet code cleanup and type hints (#52533)
This commit is contained in:
16
tests/components/speedtestdotnet/conftest.py
Normal file
16
tests/components/speedtestdotnet/conftest.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""Conftest for speedtestdotnet."""
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.components.speedtestdotnet import MOCK_RESULTS, MOCK_SERVERS
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_api():
|
||||
"""Mock entry setup."""
|
||||
with patch("speedtest.Speedtest") as mock_api:
|
||||
mock_api.return_value.get_servers.return_value = MOCK_SERVERS
|
||||
mock_api.return_value.get_best_server.return_value = MOCK_SERVERS[1][0]
|
||||
mock_api.return_value.results.dict.return_value = MOCK_RESULTS
|
||||
yield mock_api
|
||||
Reference in New Issue
Block a user