Skip to content

Commit

Permalink
stubbing my work here
Browse files Browse the repository at this point in the history
  • Loading branch information
tobixen committed Oct 26, 2024
1 parent 0d99a12 commit 380c65c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
11 changes: 9 additions & 2 deletions caldav/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,15 @@ def search(
## events, tasks and journals.
## TODO: we need server compatibility hints!
## https://github.com/python-caldav/caldav/issues/402
if not comp_class and not '400' in err.reason:
return self.search(event=True, include_completed=include_completed, sort_keys=sort_keys, split_expanded=split_expanded, props=props, **kwargs)
if not comp_class and not "400" in err.reason:
return self.search(
event=True,
include_completed=include_completed,
sort_keys=sort_keys,
split_expanded=split_expanded,
props=props,
**kwargs,
)
raise

for o in objects:
Expand Down
2 changes: 1 addition & 1 deletion tests/compatibility_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

'no_current-user-principal':
"""Current user principal not supported by the server (flag is ignored by the tests as for now - pass the principal URL as the testing URL and it will work, albeit with one warning""",

'no_recurring':
"""Server is having issues with recurring events and/or todos. """
"""date searches covering recurrances may yield no results, """
Expand Down
21 changes: 14 additions & 7 deletions tests/test_caldav.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
END:VCALENDAR
"""

attendee1="""
attendee1 = """
BEGIN:VCALENDAR
PRODID:-//Example Corp.//CalDAV Client//EN
VERSION:2.0
Expand Down Expand Up @@ -686,7 +686,7 @@ def _fixCalendar(self, **kwargs):
ret = self.principal.make_calendar(
name=name, cal_id=self.testcal_id, **kwargs
)
if self.check_compatibility_flag('search_always_needs_comptype'):
if self.check_compatibility_flag("search_always_needs_comptype"):
ret.objects = lambda load_objects: ret.events()
if self.cleanup_regime == "post":
self.calendars_used.append(ret)
Expand All @@ -708,7 +708,7 @@ def testSchedulingInfo(self):
self.skip_on_compatibility_flag("no_scheduling")
calendar_user_address_set = self.principal.calendar_user_address_set()
me_a_participant = self.principal.get_vcal_address()

def testSchedulingMailboxes(self):
self.skip_on_compatibility_flag("no_scheduling")
self.skip_on_compatibility_flag("no_scheduling_mailbox")
Expand Down Expand Up @@ -872,11 +872,18 @@ def testCreateDeleteCalendar(self):
def testChangeAttendeeStatusWithEmailGiven(self):
self.skip_on_compatibility_flag("read_only")
c = self._fixCalendar()
event = c.save_event(uid='test1', dtstart=datetime(2015, 10, 10, 8, 7, 6), dtend=datetime(2015, 10, 10, 9, 7, 6), ical_fragment='ATTENDEE;ROLE=OPT-PARTICIPANT;PARTSTAT=TENTATIVE:MAILTO:[email protected]')
event.change_attendee_status(attendee='[email protected]', PARTSTAT='ACCEPTED')
event = c.save_event(
uid="test1",
dtstart=datetime(2015, 10, 10, 8, 7, 6),
dtend=datetime(2015, 10, 10, 9, 7, 6),
ical_fragment="ATTENDEE;ROLE=OPT-PARTICIPANT;PARTSTAT=TENTATIVE:MAILTO:[email protected]",
)
event.change_attendee_status(
attendee="[email protected]", PARTSTAT="ACCEPTED"
)
event.save()
event = c.event_by_uid('test1')
import pdb; pdb.set_trace()
event = c.event_by_uid("test1")
## TODO: work in progress ... see https://github.com/python-caldav/caldav/issues/399

def testCreateEvent(self):
self.skip_on_compatibility_flag("read_only")
Expand Down

0 comments on commit 380c65c

Please sign in to comment.