summaryrefslogtreecommitdiff
path: root/testenv
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-07-13 04:10:26 +0300
committerDevaev Maxim <[email protected]>2020-07-14 09:04:52 +0300
commit77f3dab55c52859490619825ace4620a5d134901 (patch)
tree90ac48b6cb5108543f9f3bad423c8a05de0e1ace /testenv
parent07fb731b215a560bdc0a89a1fd5c199d910034a3 (diff)
optional quality and resolution
Diffstat (limited to 'testenv')
-rw-r--r--testenv/tests/validators/test_basic.py1
-rw-r--r--testenv/tests/validators/test_kvm.py15
2 files changed, 16 insertions, 0 deletions
diff --git a/testenv/tests/validators/test_basic.py b/testenv/tests/validators/test_basic.py
index 85a84d5d..1e8feb0c 100644
--- a/testenv/tests/validators/test_basic.py
+++ b/testenv/tests/validators/test_basic.py
@@ -142,6 +142,7 @@ def test_fail__valid_float_f01(arg: Any) -> None:
# =====
@pytest.mark.parametrize("arg, retval", [
("a, b, c", ["a", "b", "c"]),
+ ("a, b,, c", ["a", "b", "c"]),
("a b c", ["a", "b", "c"]),
(["a", "b", "c"], ["a", "b", "c"]),
("", []),
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))