supervisor/tests/hardware/test_data.py
Pascal Vizeli 04f36e92e1
Return list of possible data disk targets (#3133)
* Return list of possible data disk targets

* fix path

* fix tests

* Add test

* Fix tests

* Add tests

* Add more tests

* Remove debug

* Address comments

* more clear
2021-09-21 14:51:58 +02:00

25 lines
558 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