Skip to content

Commit

Permalink
Added unit test for daterange.from_date period paramter
Browse files Browse the repository at this point in the history
  • Loading branch information
runfalk committed May 11, 2017
1 parent 2d6cc65 commit ccca938
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_daterange.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ def test_from_date_type_check(param):
daterange.from_date(param)


@pytest.mark.parametrize("period", [
"Year",
"YEAR",
"foobar",
])
def test_from_date_period_check(period):
with pytest.raises(ValueError):
daterange.from_date(date(2000, 1, 1), period=period)


@pytest.mark.parametrize("year, iso_week, first_day", [
(2000, 1, date(2000, 1, 3)),
(2000, 2, date(2000, 1, 10)),
Expand Down

0 comments on commit ccca938

Please sign in to comment.