Debian Codegraph @

recurring_ical_events/test/test_issue_44_day_event_reported_twice.py

raw symbols SCIP
1 """
2 It seems that the event is reported on its day and the next.
3
4 See https://github.com/niccokunzmann/python-recurring-ical-events/issues/44
5 """
6
7 import pytest
8
9
10 def test_event_is_present_where_it_should_be(calendars):
11 events = calendars.issue_44_double_event.at((2020, 8, 14))
12 assert len(events) == 1
13 event = events[0]
14 assert event["SUMMARY"] == "test2"
15
16
17 def test_event_is_absent_on_the_next_day(calendars):
18 events = calendars.issue_44_double_event.at((2020, 8, 15))
19 assert events == [], "the issue is that an event could turn up here"
20
21
22 def test_event_is_absent_on_the_previous_day(calendars):
23 events = calendars.issue_44_double_event.at((2020, 8, 13))
24 assert events == [], "the issue is that an event could turn up here"
25
26
27 @pytest.mark.parametrize("offset", list(range(4)))
28 def test_event_of_recurrence_should_behave_the_same(calendars, offset):
29 """we should check that a repeated event does not have the same problem."""
30 events = calendars.one_day_event_repeat_every_day.at((2019, 3, 4 + offset))
31 assert len(events) == 1, (
32 "Events of the the day before and after should not be mentioned."
33 )