We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 332b5ac commit 4b84271Copy full SHA for 4b84271
tests/unit/sdk/test_yaml.py
@@ -1,5 +1,9 @@
1
from pathlib import Path
2
3
+import pytest
4
+
5
+from infrahub_sdk.exceptions import FileNotValidError
6
+from infrahub_sdk.utils import get_fixtures_dir
7
from infrahub_sdk.yaml import YamlFile
8
9
here = Path(__file__).parent.resolve()
@@ -42,3 +46,9 @@ def test_read_multiple_files_invalid() -> None:
42
46
assert yaml_files[0].valid is True
43
47
assert yaml_files[1].document_position == 2
44
48
assert yaml_files[1].valid is False
49
50
51
+def test_load_non_existing_folder():
52
+ with pytest.raises(FileNotValidError) as exc:
53
+ YamlFile.load_from_disk(paths=[get_fixtures_dir() / "does_not_exist"])
54
+ assert "does not exist" in str(exc.value)
0 commit comments