summaryrefslogtreecommitdiff
path: root/testenv/tests/validators/test_kvm.py
diff options
context:
space:
mode:
Diffstat (limited to 'testenv/tests/validators/test_kvm.py')
-rw-r--r--testenv/tests/validators/test_kvm.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/testenv/tests/validators/test_kvm.py b/testenv/tests/validators/test_kvm.py
index ccafdbce..71ec1b26 100644
--- a/testenv/tests/validators/test_kvm.py
+++ b/testenv/tests/validators/test_kvm.py
@@ -32,6 +32,7 @@ from kvmd.validators.kvm import valid_atx_button
from kvmd.validators.kvm import valid_log_seek
from kvmd.validators.kvm import valid_stream_quality
from kvmd.validators.kvm import valid_stream_fps
+from kvmd.validators.kvm import valid_stream_resolution
from kvmd.validators.kvm import valid_hid_key
from kvmd.validators.kvm import valid_hid_mouse_move
from kvmd.validators.kvm import valid_hid_mouse_button
@@ -105,6 +106,20 @@ def test_fail__valid_stream_fps(arg: Any) -> None:
# =====
[email protected]("arg", ["1280x720 ", "1x1"])
+def test_ok__valid_stream_resolution(arg: Any) -> None:
+ value = valid_stream_resolution(arg)
+ assert type(value) == str # pylint: disable=unidiomatic-typecheck
+ assert value == str(arg).strip()
+
+
[email protected]("arg", ["x", None, "0x0", "0x1", "1x0", "1280", "1280x", "1280x720x"])
+def test_fail__valid_stream_resolution(arg: Any) -> None:
+ with pytest.raises(ValidatorError):
+ print(valid_stream_resolution(arg))
+
+
+# =====
def test_ok__valid_hid_key() -> None:
for key in KEYMAP:
print(valid_hid_key(key))