hass-core/tests/components/nextcloud/conftest.py
Michael 45262c6114
Implement config flow for nextcloud (#89396)
* implement config flow

* add tests

* fix hassfest and requirements

* abort import on connection error

* add add_suggested_values_to_schema

* mock async_setup_entry

* revert code owner change

* fix try connect in config flow

* add device info

* allow multiple instances

* fix import in config flow

* remove custom scan interval from coordinator

* applay suggestions

* apply suggestions

* take over ownership from @meichthys

* cleanup import data before passing to user step

* apply suggestions to tests

* add untested files to .coveragerc
2023-03-26 21:14:17 +02:00

25 lines
597 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."""
ncm = Mock(
update=Mock(return_value=True),
)
return ncm
@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