is_allowed_path: Also unit test folder #12788 #12807 (#12810)

This commit is contained in:
Johann Kellerman 2018-03-01 19:55:58 +02:00 committed by Paulus Schoutsen
parent fec7c87ff3
commit 125088449a
2 changed files with 2 additions and 1 deletions

View File

@ -1068,7 +1068,7 @@ class Config(object):
"""Check if the path is valid for access from outside.""" """Check if the path is valid for access from outside."""
assert path is not None assert path is not None
parent = pathlib.Path(path).parent parent = pathlib.Path(path)
try: try:
parent = parent.resolve() # pylint: disable=no-member parent = parent.resolve() # pylint: disable=no-member
except (FileNotFoundError, RuntimeError, PermissionError): except (FileNotFoundError, RuntimeError, PermissionError):

View File

@ -809,6 +809,7 @@ class TestConfig(unittest.TestCase):
valid = [ valid = [
test_file, test_file,
tmp_dir
] ]
for path in valid: for path in valid:
assert self.config.is_allowed_path(path) assert self.config.is_allowed_path(path)