Files
supervisor/tests/hardware/test_data.py
Stefan Agner f6faa18409 Bump pre-commit ruff to 0.5.7 and reformat (#5242)
It seems that the codebase is not formatted with the latest ruff
version. This PR reformats the codebase with ruff 0.5.7.
2024-08-13 20:53:56 +02:00

26 lines
559 B
Python

"""Test HardwareManager Module."""
from pathlib import Path
from supervisor.hardware.data import Device
# pylint: disable=protected-access
def test_device_property(coresys):
"""Test device cgroup policy."""
device = Device(
"ttyACM0",
Path("/dev/ttyACM0"),
Path("/sys/bus/usb/001"),
"tty",
None,
[Path("/dev/serial/by-id/fixed-device")],
{"MAJOR": "5", "MINOR": "10"},
[],
)
assert device.by_id == device.links[0]
assert device.major == 5
assert device.minor == 10