diff options
-rw-r--r-- | testenv/tests/validators/test_kvm.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testenv/tests/validators/test_kvm.py b/testenv/tests/validators/test_kvm.py index f0bfaa22..27bc1d67 100644 --- a/testenv/tests/validators/test_kvm.py +++ b/testenv/tests/validators/test_kvm.py @@ -42,6 +42,7 @@ from kvmd.validators.kvm import valid_hid_mouse_wheel from kvmd.validators.kvm import valid_ugpio_driver from kvmd.validators.kvm import valid_ugpio_channel from kvmd.validators.kvm import valid_ugpio_mode +from kvmd.validators.kvm import valid_ugpio_view_table # ===== @@ -246,3 +247,24 @@ def test_ok__valid_ugpio_mode(arg: Any) -> None: def test_fail__valid_ugpio_mode(arg: Any) -> None: with pytest.raises(ValidatorError): print(valid_ugpio_mode(arg)) + + +# ===== [email protected]("arg,retval", [ + ([], []), + ({}, []), + ([[]], [[]]), + ([{}], [[]]), + ([[[]]], [["[]"]]), + ("", []), + ("ab", [["a"], ["b"]]), + ([[1, 2], [None], "ab", {}, [3, 4]], [["1", "2"], ["None"], ["a", "b"], [], ["3", "4"]]), +]) +def test_ok__valid_ugpio_view_table(arg: Any, retval: Any) -> None: + assert valid_ugpio_view_table(arg) == retval + + [email protected]("arg", [None, [None], 1]) +def test_fail__valid_ugpio_view_table(arg: Any) -> None: + with pytest.raises(ValidatorError): + print(valid_ugpio_view_table(arg)) |