1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 12:29:08 +00:00

Fix defaults for builds (#2675)

This commit is contained in:
Pascal Vizeli
2021-03-04 11:48:25 +01:00
committed by GitHub
parent 169c7ec004
commit 09203f67b2
5 changed files with 43 additions and 17 deletions

View File

@@ -0,0 +1,21 @@
"""Test common."""
from pathlib import Path
import pytest
from supervisor.exceptions import ConfigurationFileError
from supervisor.utils.common import find_one_filetype
def test_not_found(tmp_path):
"""Test default."""
with pytest.raises(ConfigurationFileError):
find_one_filetype(tmp_path, "test", [".json"])
def test_with_found(tmp_path):
"""Test default."""
test_file = Path(tmp_path, "test.json")
test_file.write_text("found")
assert find_one_filetype(tmp_path, "test", [".json"]) == test_file