diff options
author | Devaev Maxim <[email protected]> | 2019-10-24 01:21:34 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-10-24 01:21:34 +0300 |
commit | 97e2d9128c37805ba649807f5f923d1d1e92907f (patch) | |
tree | 36ddaa7318cea97edf55ef994052b14a28e36305 /testenv | |
parent | 372bf2a4afc93726ad63090202b517c939a183d9 (diff) |
strict file validation
Diffstat (limited to 'testenv')
-rw-r--r-- | testenv/tests/validators/test_os.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/testenv/tests/validators/test_os.py b/testenv/tests/validators/test_os.py index 353cb9e0..47598ce1 100644 --- a/testenv/tests/validators/test_os.py +++ b/testenv/tests/validators/test_os.py @@ -29,7 +29,6 @@ import pytest from kvmd.validators import ValidatorError from kvmd.validators.os import valid_abs_path -from kvmd.validators.os import valid_abs_path_exists from kvmd.validators.os import valid_printable_filename from kvmd.validators.os import valid_unix_mode from kvmd.validators.os import valid_command @@ -63,21 +62,22 @@ def test_fail__valid_abs_path(arg: Any) -> None: ("/root", "/root"), (".", os.path.abspath(".")), ]) -def test_ok__valid_abs_path_exists(arg: Any, retval: str) -> None: - assert valid_abs_path_exists(arg) == retval +def test_ok__valid_abs_path__dir(arg: Any, retval: str) -> None: + assert valid_abs_path(arg, type="dir") == retval @pytest.mark.parametrize("arg", [ - "/f/o/o/b/a/r", + "/etc/passwd", + "/etc/passwd/", "~", "/foo~", "/foo/~", "", None, ]) -def test_fail__valid_abs_path_exists(arg: Any) -> None: +def test_fail__valid_abs_path__dir(arg: Any) -> None: with pytest.raises(ValidatorError): - print(valid_abs_path_exists(arg)) + print(valid_abs_path(arg, type="dir")) # ===== |