From 4cfc84ab74bc17aae8157c3f5889019394a6959f Mon Sep 17 00:00:00 2001 From: Tobias Brox Date: Thu, 11 Mar 2021 00:32:33 +0100 Subject: [PATCH] Should recommend to use .objects rather than .events. Particularly due to https://github.com/python-caldav/caldav/issues/116 --- examples/basic_usage_examples.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/basic_usage_examples.py b/examples/basic_usage_examples.py index d285280f..24d73435 100644 --- a/examples/basic_usage_examples.py +++ b/examples/basic_usage_examples.py @@ -94,6 +94,13 @@ ## events()-method. Recurring events will not be expanded. all_events = the_same_calendar.events() +## It's also possible to use .objects. +all_objects = the_same_calendar.objects() + +## since we have only added events (and neither todos nor journals), those +## should be equal ... except, all_objects is an iterator and not a list. +assert(len(all_events) == len(list(all_objects)) + ## Let's check that the summary got right assert all_events[0].vobject_instance.vevent.summary.value.startswith('Norwegian')