Skip to content

Commit

Permalink
workaround for #360
Browse files Browse the repository at this point in the history
  • Loading branch information
tobixen committed Dec 28, 2023
1 parent cd860b3 commit 0713406
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions tests/compatibility_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -375,6 +378,7 @@
'text_search_not_working',
'no_relships',
'isnotdefined_not_working',
'robur_rrule_freq_yearly_expands_monthly'
]

posteo = [
Expand Down
12 changes: 9 additions & 3 deletions tests/test_caldav.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0713406

Please sign in to comment.