From ff83efe376fb6d42fe8b4fad763044cfb55d5e8c Mon Sep 17 00:00:00 2001 From: Johann Kellerman Date: Thu, 1 Mar 2018 19:55:58 +0200 Subject: [PATCH] is_allowed_path: Also unit test folder #12788 #12807 (#12810) --- homeassistant/core.py | 2 +- tests/test_core.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/core.py b/homeassistant/core.py index 8ff9d9cfd81..543aba2a0e7 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -1064,7 +1064,7 @@ class Config(object): """Check if the path is valid for access from outside.""" assert path is not None - parent = pathlib.Path(path).parent + parent = pathlib.Path(path) try: parent = parent.resolve() # pylint: disable=no-member except (FileNotFoundError, RuntimeError, PermissionError): diff --git a/tests/test_core.py b/tests/test_core.py index 77a7872526f..261b6385b04 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -809,6 +809,7 @@ class TestConfig(unittest.TestCase): valid = [ test_file, + tmp_dir ] for path in valid: assert self.config.is_allowed_path(path)