Skip to content

Commit ebc5df8

Browse files
bkircherJonathan, Lutterbeck
authored and
Jonathan, Lutterbeck
committed
tests: Ensure load_config does not interpret file name
1 parent 5fe3df0 commit ebc5df8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_config.py

+12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os.path
2+
import shutil
23

34
import pytest
45

@@ -31,6 +32,17 @@ def test_load_config_from_yaml():
3132
assert res[1]["name"] == "something-else"
3233

3334

35+
def test_load_config_works_without_fileext(tmp_path):
36+
"""Ensure load_config does not interpret file path or file name."""
37+
38+
example_config = os.path.join(CURRENT_DIR, "example-config.yaml")
39+
dest = tmp_path / "a"
40+
shutil.copyfile(example_config, dest)
41+
res = load_config(dest)
42+
assert isinstance(res, list)
43+
assert len(res) == 2
44+
45+
3446
def test_load_config_handles_non_existing_file():
3547
""" "Ensure load_config raises FileNotFoundError."""
3648

0 commit comments

Comments
 (0)