Debian Codegraph @

recurring_ical_events/test/test_at_function.py

raw symbols SCIP
1 from datetime import date, datetime
2
3 import pytest
4
5
6 @pytest.mark.parametrize(
7 ("a_date", "count"),
8 [
9 # Year
10 (2018, 3),
11 ((2018,), 3),
12 # Month
13 ((2018, 1), 3),
14 # Day
15 ((2018, 1, 11), 1),
16 (date(2018, 1, 11), 1),
17 ("20180111", 1),
18 ((2018, 1, 9), 0),
19 (date(2018, 1, 9), 0),
20 ("20180109", 0),
21 # Datetime
22 (datetime(2018, 1, 11, 10, 0, 0), 1),
23 (datetime(2018, 1, 9, 10, 0, 0), 0),
24 ],
25 )
26 def test_at_input_arguments(a_date, count, calendars):
27 events = calendars.duration.at(a_date)
28 assert len(events) == count