Skip to content

Commit

Permalink
Ensure basename_wo_ext() works only on strings
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Jan 18, 2024
1 parent dc375de commit 57cd603
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,15 @@ def test_basename_wo_ext(path, ext, basename):
assert isinstance(b, str)


def test_basename_wo_ext_symlink(tmpdir):
# Ensure basename_wo_ext() is not influenced by existing files
file = audeer.touch(tmpdir, "file.txt")
link = os.path.join(tmpdir, "link.txt")
os.symlink(file, link)
assert audeer.basename_wo_ext(file) == "file"
assert audeer.basename_wo_ext(link) == "link"


@pytest.mark.parametrize(
"dirs,expected",
[
Expand Down

0 comments on commit 57cd603

Please sign in to comment.