File: test_issue_164_duplicated_event.py

package info (click to toggle)
python-recurring-ical-events 3.3.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,128 kB
  • sloc: python: 2,896; sh: 15; makefile: 3
file content (15 lines) | stat: -rw-r--r-- 587 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""Duplicated instances of the same event are returned in v3.1.0. The bug is not present in v2.1.3.

See https://github.com/niccokunzmann/python-recurring-ical-events/issues/164
"""


def test_event_is_only_returned_once(calendars):
    """We should not see the same event twice!"""
    events = calendars.issue_164_duplicated_event.at([2024, 8])
    for event in events:
        start = event["DTSTART"].dt
        duration = event["DTEND"].dt - event["DTSTART"].dt
        print(f"start {start} duration {duration}")
        print(event.to_ical().decode())
    assert len(events) == 2