Skip to content

Commit

Permalink
dont treat components with a subset of other a larger components' sub…
Browse files Browse the repository at this point in the history
…components as equal to the bigger component
  • Loading branch information
jacadzaca committed Sep 1, 2023
1 parent 4f00286 commit 2dfd51c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/icalendar/cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ def __repr__(self):
return f"{self.name or type(self).__name__}({dict(self)}{', ' + subs if subs else ''})"

def __eq__(self, other):
if not len(self.subcomponents) == len(other.subcomponents):
return False

properties_equal = super().__eq__(other)
if not properties_equal:
return False
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:icalendar-2023
BEGIN:VEVENT
UID:1
SUMMARY: Some event ':'
DTSTART;TZID="Western/Central Europe";VALUE=DATE-TIME:20211101T160000
DTEND;TZID="Western/Central Europe";VALUE=DATE-TIME:20211101T163000
DTSTAMP:20211004T150245Z
END:VEVENT
END:VCALENDAR
1 change: 1 addition & 0 deletions src/icalendar/tests/test_unit_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ def test_cal_strict_parsing(self):
'issue_178_custom_component_inside_other',
'issue_526_calendar_with_events',
'issue_526_calendar_with_different_events',
'issue_526_calendar_with_event_subset',
], repeat=2)
)
def test_comparing_calendars(calendars, calendar, other_calendar):
Expand Down

0 comments on commit 2dfd51c

Please sign in to comment.