Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
natoverse committed Aug 13, 2024
1 parent 8d0b54a commit 210ed7e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/unit/query/test_infer_data_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@ def test_infer_data_dir():
result = Path(_infer_data_dir(root))
assert result.match("20240812-121000/artifacts") is True


def test_infer_data_dir_ignores_hidden_files():
""" A hidden file, starting with '.', will naturally be selected as latest data directory."""
"""A hidden file, starting with '.', will naturally be selected as latest data directory."""
root = "./tests/unit/query/data/hidden"
result = Path(_infer_data_dir(root))
print(result)
assert result.match("20240812-121000/artifacts") is True


def test_infer_data_dir_ignores_non_numeric():
root = "./tests/unit/query/data/non-numeric"
result = Path(_infer_data_dir(root))
assert result.match("20240812-121000/artifacts") is True


def test_infer_data_dir_throws_on_no_match():
root = "./tests/unit/query/data/empty"
with pytest.raises(ValueError): # noqa PT011 (this is what is actually thrown...)
_infer_data_dir(root)
with pytest.raises(ValueError): # noqa PT011 (this is what is actually thrown...)
_infer_data_dir(root)

0 comments on commit 210ed7e

Please sign in to comment.