dont treat components with a subset of other a larger components' subcomponents as equal to the bigger component

pull/550/head
jaca 2023-09-01 20:34:32 +02:00
rodzic 4f0028663e
commit 2dfd51cf59
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B67CEF4EE3D609B0
3 zmienionych plików z 15 dodań i 0 usunięć

Wyświetl plik

@ -437,6 +437,9 @@ class Component(CaselessDict):
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

Wyświetl plik

@ -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

Wyświetl plik

@ -469,6 +469,7 @@ class TestCal(unittest.TestCase):
'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):