compose-viz/tests/test_devices.py

23 lines
662 B
Python
Raw Permalink Normal View History

2022-06-08 21:06:51 +02:00
from compose_viz.models.device import Device
2022-06-09 07:56:12 +02:00
2022-06-08 21:06:51 +02:00
def test_device_init_normal() -> None:
try:
d = Device(host_path="/dev/ttyUSB0", container_path="/dev/ttyUSB1")
assert d.host_path == "/dev/ttyUSB0"
assert d.container_path == "/dev/ttyUSB1"
except Exception as e:
assert False, e
2022-06-09 07:56:12 +02:00
2022-06-08 21:06:51 +02:00
def test_device_with_cgroup_permissions() -> None:
try:
d = Device(host_path="/dev/sda1", container_path="/dev/xvda", cgroup_permissions="rwm")
assert d.host_path == "/dev/sda1"
assert d.container_path == "/dev/xvda"
assert d.cgroup_permissions == "rwm"
except Exception as e:
2022-06-09 07:56:12 +02:00
assert False, e