mirror of
https://github.com/home-assistant/core.git
synced 2025-11-15 14:00:24 +00:00
Small cleanup in conftest mocks of PVOutput (#103628)
This commit is contained in:
@@ -34,21 +34,14 @@ def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||
yield mock_setup
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_pvoutput_config_flow() -> Generator[None, MagicMock, None]:
|
||||
"""Return a mocked PVOutput client."""
|
||||
with patch(
|
||||
"homeassistant.components.pvoutput.config_flow.PVOutput", autospec=True
|
||||
) as pvoutput_mock:
|
||||
yield pvoutput_mock.return_value
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_pvoutput() -> Generator[None, MagicMock, None]:
|
||||
"""Return a mocked PVOutput client."""
|
||||
with patch(
|
||||
"homeassistant.components.pvoutput.coordinator.PVOutput", autospec=True
|
||||
) as pvoutput_mock:
|
||||
) as pvoutput_mock, patch(
|
||||
"homeassistant.components.pvoutput.config_flow.PVOutput", new=pvoutput_mock
|
||||
):
|
||||
pvoutput = pvoutput_mock.return_value
|
||||
pvoutput.status.return_value = Status.from_dict(
|
||||
load_json_object_fixture("status.json", DOMAIN)
|
||||
|
||||
Reference in New Issue
Block a user