summaryrefslogtreecommitdiff
path: root/testenv
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-04-27 22:09:58 +0300
committerDevaev Maxim <[email protected]>2019-04-27 22:09:58 +0300
commit380b1d15e3c8fcb7cc324cebf209bfe38cbb4011 (patch)
treefe09dc5deffef71099df0acc9f983ebeaa1c492f /testenv
parentd4c597e945de5e80b6f98bc64d4faa66ceddf70b (diff)
highlevel atx api
Diffstat (limited to 'testenv')
-rw-r--r--testenv/tests/validators/test_kvm.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/testenv/tests/validators/test_kvm.py b/testenv/tests/validators/test_kvm.py
index f1050b36..cfdad69e 100644
--- a/testenv/tests/validators/test_kvm.py
+++ b/testenv/tests/validators/test_kvm.py
@@ -27,6 +27,7 @@ import pytest
from kvmd.keymap import KEYMAP
from kvmd.validators import ValidatorError
+from kvmd.validators.kvm import valid_atx_power_action
from kvmd.validators.kvm import valid_atx_button
from kvmd.validators.kvm import valid_kvm_target
from kvmd.validators.kvm import valid_log_seek
@@ -39,6 +40,18 @@ from kvmd.validators.kvm import valid_hid_mouse_wheel
# =====
[email protected]("arg", ["ON ", "OFF ", "OFF_soft ", "RESET "])
+def test_ok__valid_atx_power_action(arg: Any) -> None:
+ assert valid_atx_power_action(arg) == arg.strip().lower()
+
+
[email protected]("arg", ["test", "", None])
+def test_fail__valid_atx_power_action(arg: Any) -> None:
+ with pytest.raises(ValidatorError):
+ print(valid_atx_power_action(arg))
+
+
+# =====
@pytest.mark.parametrize("arg", ["POWER ", "POWER_LONG ", "RESET "])
def test_ok__valid_atx_button(arg: Any) -> None:
assert valid_atx_button(arg) == arg.strip().lower()