diff options
Diffstat (limited to 'testenv')
-rw-r--r-- | testenv/tests/validators/test_basic.py | 1 | ||||
-rw-r--r-- | testenv/tests/validators/test_kvm.py | 15 |
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)) |