add: device test
This commit is contained in:
parent
600ca95ba5
commit
698a9a770b
1 changed files with 20 additions and 0 deletions
20
tests/test_devices.py
Normal file
20
tests/test_devices.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from compose_viz.models.device import Device
|
||||
|
||||
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
|
||||
|
||||
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:
|
||||
assert False, e
|
Loading…
Reference in a new issue