hass-core/tests/components/nextcloud/conftest.py
Sid 0d66d298ec
Enable Ruff RET504 (#114528)
* Enable Ruff RET504

* fix test

* Use noqa instead of cast

* fix sonos RET504

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-06 11:07:37 +02:00

23 lines
582 B
Python

"""Fixtrues for the Nextcloud integration tests."""
from collections.abc import Generator
from unittest.mock import AsyncMock, Mock, patch
import pytest
@pytest.fixture
def mock_nextcloud_monitor() -> Mock:
"""Mock of NextcloudMonitor."""
return Mock(
update=Mock(return_value=True),
)
@pytest.fixture
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.nextcloud.async_setup_entry", return_value=True
) as mock_setup_entry:
yield mock_setup_entry