X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=test%2Fintegration%2Ftestlib%2Fcheck.py;fp=test%2Fintegration%2Ftestlib%2Fcheck.py;h=0f3b414b0f4fa972718231c594ce5ab2e4f3f1a1;hp=3b7dec170286fbebd79d35d46281cf176be6df8d;hb=c6a15e27d934e90a1f3a26438dddb395bdc9de19;hpb=1695d8828ed6fb997dbd96e21c105ab5641b90c5 diff --git a/test/integration/testlib/check.py b/test/integration/testlib/check.py index 3b7dec17..0f3b414b 100755 --- a/test/integration/testlib/check.py +++ b/test/integration/testlib/check.py @@ -104,6 +104,12 @@ def files_eq(path0: str, path1: str) -> None: def file_exists(path: T.Union[str, Path]) -> None: - """Check that file or directory exists.""" - if not os.path.exists(path): - raise ValueError("expected path '{path}' to exist") + """Check that file exists.""" + if not os.path.isfile(path): + raise ValueError(f"expected file '{path}' to exist") + + +def dir_exists(path: T.Union[str, Path]) -> None: + """Check that directory exists.""" + if not os.path.isdir(path): + raise ValueError(f"expected directory '{path}' to exist")