diff options
Diffstat (limited to 'testenv')
-rw-r--r-- | testenv/tests/validators/test_kvm.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testenv/tests/validators/test_kvm.py b/testenv/tests/validators/test_kvm.py index fb223d6a..eeedb4d0 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_msd_image_name 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,30 @@ def test_fail__valid_stream_fps(arg: Any) -> None: # ===== [email protected]("arg, retval", [ + ("archlinux-2018.07.01-i686.iso", "archlinux-2018.07.01-i686.iso"), + ("archlinux-2018.07.01-x86_64.iso", "archlinux-2018.07.01-x86_64.iso"), + ("dsl-4.11.rc1.iso", "dsl-4.11.rc1.iso"), + ("systemrescuecd-x86-5.3.1.iso", "systemrescuecd-x86-5.3.1.iso"), + ("ubuntu-16.04.5-desktop-i386.iso", "ubuntu-16.04.5-desktop-i386.iso"), + (".", "_"), + ("..", "__"), + ("/..", "_.."), + ("/root/..", "_root_.."), + (" тест(){}[ \t].iso\t", "тест()__[__].iso"), + ("?" * 1000, "_" * 255), +]) +def test_ok__valid_msd_image_name(arg: Any, retval: str) -> None: + assert valid_msd_image_name(arg) == retval + + [email protected]("arg", ["", None]) +def test_fail__valid_msd_image_name(arg: Any) -> None: + with pytest.raises(ValidatorError): + print(valid_msd_image_name(arg)) + + +# ===== def test_ok__valid_hid_key() -> None: for key in KEYMAP: print(valid_hid_key(key)) |