Skip to content

Commit

Permalink
tests: Ensure load_config does not interpret file name
Browse files Browse the repository at this point in the history
  • Loading branch information
bkircher authored and Jonathan, Lutterbeck committed Jun 2, 2022
1 parent 5fe3df0 commit ebc5df8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os.path
import shutil

import pytest

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


def test_load_config_works_without_fileext(tmp_path):
"""Ensure load_config does not interpret file path or file name."""

example_config = os.path.join(CURRENT_DIR, "example-config.yaml")
dest = tmp_path / "a"
shutil.copyfile(example_config, dest)
res = load_config(dest)
assert isinstance(res, list)
assert len(res) == 2


def test_load_config_handles_non_existing_file():
""" "Ensure load_config raises FileNotFoundError."""

Expand Down

0 comments on commit ebc5df8

Please sign in to comment.