Add missing async_setup_entry mock in openuv (#88661)
This commit is contained in:
parent
6511b3f355
commit
dac3c7179f
2 changed files with 13 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
"""Define test fixtures for OpenUV."""
|
||||
from collections.abc import Generator
|
||||
import json
|
||||
from unittest.mock import AsyncMock, Mock, patch
|
||||
|
||||
|
@ -20,6 +21,15 @@ TEST_LATITUDE = 51.528308
|
|||
TEST_LONGITUDE = -0.3817765
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||
"""Override async_setup_entry."""
|
||||
with patch(
|
||||
"homeassistant.components.openuv.async_setup_entry", return_value=True
|
||||
) as mock_setup_entry:
|
||||
yield mock_setup_entry
|
||||
|
||||
|
||||
@pytest.fixture(name="client")
|
||||
def client_fixture(data_protection_window, data_uv_index):
|
||||
"""Define a mock Client object."""
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
from pyopenuv.errors import InvalidApiKeyError
|
||||
import pytest
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant import data_entry_flow
|
||||
|
@ -17,6 +18,8 @@ from homeassistant.core import HomeAssistant
|
|||
|
||||
from .conftest import TEST_API_KEY, TEST_ELEVATION, TEST_LATITUDE, TEST_LONGITUDE
|
||||
|
||||
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
|
||||
|
||||
|
||||
async def test_create_entry(hass: HomeAssistant, client, config, mock_pyopenuv) -> None:
|
||||
"""Test creating an entry."""
|
||||
|
|
Loading…
Add table
Reference in a new issue