Use set literals in tests (#33669)

This commit is contained in:
Franck Nijhof authored and GitHub committed 2020-04-05 02:20:09 +02:00
1 parent d267d674b9
commit 03dd92d51b
9 files changed
+24 -28

No files matched your search

+2 -2
View File
@@ -920,7 +920,7 @@ class TestConfig(unittest.TestCase):
with TemporaryDirectory() as tmp_dir:
# The created dir is in /tmp. This is a symlink on OS X
# causing this test to fail unless we resolve path first.
self.config.whitelist_external_dirs = set((os.path.realpath(tmp_dir),))
self.config.whitelist_external_dirs = {os.path.realpath(tmp_dir)}
test_file = os.path.join(tmp_dir, "test.jpg")
with open(test_file, "w") as tmp_file:
@@ -930,7 +930,7 @@ class TestConfig(unittest.TestCase):
for path in valid:
assert self.config.is_allowed_path(path)
self.config.whitelist_external_dirs = set(("/home", "/var"))
self.config.whitelist_external_dirs = {"/home", "/var"}
unvalid = [
"/hass/config/secure",