* add webmin integration 1 * refactor, add memory sensors * Fix docstring * addressed reviews * address reviews * address reviews * use translation strings for sensors * add async_abort_entries_match * apply review comments * address reviews * add async_set_unique_id * add identifiers to device_info * disable all sensors by default * move icons to icons.json * show Faults when given from server in config flow * add test for Fault * Apply review suggestions * Create helper functions for webmin instance and sorted mac addresses * fix tests
33 lines
789 B
Python
33 lines
789 B
Python
"""Fixtures for Webmin integration tests."""
|
|
from collections.abc import Generator
|
|
from unittest.mock import AsyncMock, patch
|
|
|
|
import pytest
|
|
|
|
from homeassistant.components.webmin.const import DEFAULT_PORT
|
|
from homeassistant.const import (
|
|
CONF_HOST,
|
|
CONF_PASSWORD,
|
|
CONF_PORT,
|
|
CONF_SSL,
|
|
CONF_USERNAME,
|
|
CONF_VERIFY_SSL,
|
|
)
|
|
|
|
TEST_USER_INPUT = {
|
|
CONF_HOST: "192.168.1.1",
|
|
CONF_USERNAME: "user",
|
|
CONF_PASSWORD: "pass",
|
|
CONF_PORT: DEFAULT_PORT,
|
|
CONF_SSL: True,
|
|
CONF_VERIFY_SSL: False,
|
|
}
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
|
"""Mock setting up a config entry."""
|
|
with patch(
|
|
"homeassistant.components.webmin.async_setup_entry", return_value=True
|
|
) as mock_setup:
|
|
yield mock_setup
|