Skip to content

Commit

Permalink
renamed module
Browse files Browse the repository at this point in the history
  • Loading branch information
klinga committed Mar 18, 2024
1 parent 8f0d341 commit 0cf191b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import pytest


from google_books.utils import fh_date


@pytest.mark.parametrize(
"arg,expectation",
[
("nyp_20231208_google.txt", "20231208"),
("nyp_20240101_google_recap.txt", "20240101"),
],
)
def test_report_name_base_valid(arg, expectation):
assert fh_date(arg) == expectation


@pytest.mark.parametrize(
"arg",
["foo", "20231208_google.txt", "nyp_foo_google.txt", "nyp-20231208-google.txt"],
)
def test_report_name_base_invalid(arg):
with pytest.raises(ValueError):
fh_date(arg)

0 comments on commit 0cf191b

Please sign in to comment.