Files
core/tests/components/synology_dsm/common.py
Patrick 9ce920b35a Add support for external USB drives to Synology DSM (#138661)
* Add external usb drives

* Add partition percentage used

* Move icons to icons.json

* Add external usb to diagnostics

* Add assert for external usb entity

* Fix reset external_usb

* Update homeassistant/components/synology_dsm/diagnostics.py

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

* Update homeassistant/components/synology_dsm/diagnostics.py

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

* Fix diagnostics

* Make each partition a device

* Add usb sensor tests

* Add diagnostics tests

* It is possible that api.external_usb is None

* Merge upstream into syno_external_usb

* add manufacturer and model to partition

* fix tests

---------

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
Co-authored-by: mib1185 <mail@mib85.de>
2025-04-29 13:32:21 +02:00

33 lines
813 B
Python

"""Configure Synology DSM tests."""
from __future__ import annotations
from unittest.mock import AsyncMock, Mock
from awesomeversion import AwesomeVersion
from .consts import SERIAL
def mock_dsm_information(
serial: str | None = SERIAL,
update_result: bool = True,
awesome_version: str = "7.2.2",
model: str = "DS1821+",
version_string: str = "DSM 7.2.2-72806 Update 3",
ram: int = 32768,
temperature: int = 58,
uptime: int = 123456,
) -> Mock:
"""Mock SynologyDSM information."""
return Mock(
serial=serial,
update=AsyncMock(return_value=update_result),
awesome_version=AwesomeVersion(awesome_version),
model=model,
version_string=version_string,
ram=ram,
temperature=temperature,
uptime=uptime,
)