From d0c510843126a7cfd5de24043ec5d78910038848 Mon Sep 17 00:00:00 2001 From: Tobias Brox Date: Thu, 28 Dec 2023 23:02:53 +0100 Subject: [PATCH] workaround for https://github.com/python-caldav/caldav/issues/360 --- CHANGELOG.md | 3 ++- tests/compatibility_issues.py | 4 ++++ tests/test_caldav.py | 12 +++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81acf2d..ed7963e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,9 +19,10 @@ This project should more or less adhere to [Semantic Versioning](https://semver. * Code formatting / style fixes. * Search method did some logic handling non-conformant servers (loading data from the server if the search response didn't include the icalendar data, ignoring trash from the Google server when it returns data without a VTODO/VEVENT/VJOURNAL component. -* Tests - a breakage was introduced for servers not supporting MKCALENDAR - details in https://github.com/python-caldav/caldav/pull/368 * Revisited a problem that Google sometimes delivers junk when doing searches - credits to github user @zhwei in https://github.com/python-caldav/caldav/pull/366 * There were some compatibility-logic loading objects if the server does not deliver icalendar data (as it's suppsoed to do according to the RFC), but only if passing the `expand`-flag to the `search`-method. Fixed that it loads regardless of weather `expand` is set or not. Also in https://github.com/python-caldav/caldav/pull/366 +* Tests - a breakage was introduced for servers not supporting MKCALENDAR - details in https://github.com/python-caldav/caldav/pull/368 +* Tests - all tests passes for python 3.12 as well - as expected. ### Changed diff --git a/tests/compatibility_issues.py b/tests/compatibility_issues.py index 2e126f9..6cfdd3e 100644 --- a/tests/compatibility_issues.py +++ b/tests/compatibility_issues.py @@ -192,6 +192,9 @@ 'search_needs_comptype': """The server may not always come up with anything useful when searching for objects and omitting to specify weather one wants to see tasks or events""", + + 'robur_rrule_freq_yearly_expands_monthly': + """Robur expands a yearly event into a monthly event. I believe I've reported this one upstream at some point, but can't find back to it""" } xandikos = [ @@ -375,6 +378,7 @@ 'text_search_not_working', 'no_relships', 'isnotdefined_not_working', + 'robur_rrule_freq_yearly_expands_monthly' ] posteo = [ diff --git a/tests/test_caldav.py b/tests/test_caldav.py index 078559f..fac5774 100644 --- a/tests/test_caldav.py +++ b/tests/test_caldav.py @@ -2451,10 +2451,16 @@ def testRecurringDateSearch(self): ## resultset should be one vcalendar with two events. assert len(r1) == 1 assert "RRULE" not in r1[0].data - assert r1[0].data.count("END:VEVENT") == 2 + if self.check_compatibility_flag("robur_rrule_freq_yearly_expands_monthly"): + assert r1[0].data.count("END:VEVENT") == 13 + else: + assert r1[0].data.count("END:VEVENT") == 2 ## However, the new search method will by default split it into - ## two events - assert len(r2) == 2 + ## two events. Or 13, in the case of robur + if self.check_compatibility_flag("robur_rrule_freq_yearly_expands_monthly"): + assert len(r2) == 13 + else: + assert len(r2) == 2 assert "RRULE" not in r2[0].data assert "RRULE" not in r2[1].data assert r2[0].data.count("END:VEVENT") == 1