Async more tests#679
Merged
Merged
Conversation
Add async counterparts of the sync integration tests - test_object_by_sync_token: full sync-token cycle using get_objects_by_sync_token(); covers add → objects() → modify → delta fetch → add another → delta fetch → delete (sync-token.delete gated); uses asyncio.sleep(1) for time-based tokens and is_fragile guard for servers using fake/broken tokens. - test_sync: same lifecycle but via SynchronizableCalendarObjectCollection.sync(); verifies updated/deleted lists and objects_by_url() cache after each mutation. - test_search_should_yield_data: search(event=True) returns objects with non-empty .data (gated on search.unlimited-time-range) - test_search_event: comprehensive search – comp_class, todo=True, date range, UID, class_, no_class, no_category, no_dtend, category, text, sort_keys; uses ev1/ev3/evr static fixtures (old-date events) - test_search_comp_type: get_events() / get_todos() filter correctly in a mixed calendar (gated on save-load.todo.mixed-calendar) - test_search_without_comp_type: search() with no filter returns both Event and Todo objects - test_search_sort_todo: sort_keys=(uid,), (summary,), and multi-key (isnt_overdue,categories,dtstart,priority,status) produce correct order - test_date_search_and_freebusy: date-range search before/after mutating an event (ev1→ev2); freebusy_request gated on freebusy-query - test_recurring_date_search: yearly evr found without expand, expanded to 1 occurrence over a single year and 2 occurrences over two years - test_recurring_date_with_exception_search: bi-weekly evr2 expanded over a window containing both occurrences; RECURRENCE-ID assertions gated on exception-handling support flags - test_alarm: add event with VALARM; alarm_start/alarm_end search finds (or misses) it correctly; gated on search.time-range.alarm - test_todos: get_todos() sort order by (due,priority), (priority,), and (summary,priority); mirrors testTodos - test_todo_completion: complete() transitions STATUS; pending-only and include_completed filtering; get_todo_by_uid(); mirrors testTodoCompletion - test_todo_recurring_complete_safe: complete(handle_rrule=True, rrule_mode='safe') advances recurring todo; gated on save-load.todo.recurrences.count; mirrors testTodoRecurringCompleteSafe - test_todo_recurring_complete_thisandfuture: rrule_mode='thisandfuture' truncates the series; gated on save-load.todo.recurrences.thisandfuture; mirrors testTodoRecurringCompleteThisandfuture - test_todo_datesearch: search() with old-date start/end; implicit-todo and nodtstart compatibility flags respected; mirrors testTodoDatesearch - test_create_journal_list_and_journal_entry: add_journal(), get_journals(), get_journal_by_uid(), search(journal=True), get_todos/get_events return empty; mirrors testCreateJournalListAndJournalEntry - test_scheduling_mailboxes, test_propfind, test_get_calendar_home_set, test_get_default_calendar, test_get_calendar, test_principal, test_principals, test_create_delete_calendar, test_calendar_by_full_url, test_find_calendar_owner, test_set_calendar_properties test_add_organizer_full, test_change_attendee_status_with_email_given, test_add_orphaned_recurrence, test_edit_single_recurrence test_create_child_parent, test_offset_url, test_utf8_event, test_create_calendar_and_event_from_vobject, test_create_event_from_ical, test_set_due, test_create_task_list_and_todo Library fixes required to make async tests work: - collection.py: Principal.calendar() now handles full-URL cal_id without accessing calendar_home_set (which is lazy-async and breaks sync call sites) - collection.py: Principal.calendar_user_address_set() is now async-aware (adds _async_calendar_user_address_set coroutine) - async_davclient.py: AsyncDAVClient.check_dav_support() now tries principal().url first (matching sync behaviour) so Nextcloud returns calendar-access in the DAV header Part of #667 prompt: (continue working on `git bug bug show 099db26` aka `gh issue view 667`) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> AI Prompts: claude-sonnet-4-6: I added a git-bug d2eb6fa for this - anything to add to this bug report? claude-sonnet-4-6: The comment d120efb should be tagged that it's AI-generated
The previous commit adds lots of async test code, to make the async integration suite mirror the extensive sync integration tests. This has uncovered some missing pieces in the async jigsaw puzzle, routines that would blow up when used in async context. This commit fixes it all: - Calendar.freebusy_request() - _async_complete raised NotImplementedError for handle_rrule=True prompt: (look into those broken tests nad fix things ...) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> AI Prompts: claude-sonnet-4-6: check issue #667 again, are all the unchecked checkboxes there irrelevant? Is PR #679 complete?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.