-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
the test cases cover those mentioned in #27
- Loading branch information
1 parent
7678272
commit f833808
Showing
3 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
BEGIN:VCALENDAR | ||
METHOD:PUBLISH | ||
PRODID:Microsoft Exchange Server 2010 | ||
VERSION:2.0 | ||
X-WR-CALNAME:Events | ||
X-EVOLUTION-DATA-REVISION:2020-04-23T17:43:39.112248Z(2) | ||
BEGIN:VTIMEZONE | ||
TZID:W. Europe Standard Time | ||
BEGIN:STANDARD | ||
DTSTART:16010101T030000 | ||
TZOFFSETFROM:+0200 | ||
TZOFFSETTO:+0100 | ||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 | ||
END:STANDARD | ||
BEGIN:DAYLIGHT | ||
DTSTART:16010101T020000 | ||
TZOFFSETFROM:+0100 | ||
TZOFFSETTO:+0200 | ||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3 | ||
END:DAYLIGHT | ||
END:VTIMEZONE | ||
|
||
BEGIN:VEVENT | ||
UID:3bbe38c205956551730fc9233525fe268296ec02 | ||
DTSTAMP:20200423T174240Z | ||
DTSTART;TZID=/freeassociation.sourceforge.net/Europe/Berlin: | ||
20200426T140000 | ||
DTEND;TZID=/freeassociation.sourceforge.net/Europe/Berlin: | ||
20200426T143000 | ||
SUMMARY:Reoccur | ||
SEQUENCE:7 | ||
X-LIC-ERROR;X-LIC-ERRORTYPE=VALUE-PARSE-ERROR:No value for DESCRIPTION | ||
property. Removing entire property: | ||
CREATED:20200423T174316Z | ||
LAST-MODIFIED:20200423T174339Z | ||
X-LIC-ERROR;X-LIC-ERRORTYPE=VALUE-PARSE-ERROR:No value for DESCRIPTION | ||
property. Removing entire property: | ||
RRULE:FREQ=DAILY;UNTIL=20200429T000000 | ||
EXDATE:20200427T120000Z | ||
|
||
END:VEVENT | ||
END:VCALENDAR |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
BEGIN:VCALENDAR | ||
METHOD:PUBLISH | ||
PRODID:Microsoft Exchange Server 2010 | ||
VERSION:2.0 | ||
X-WR-CALNAME:Events | ||
X-EVOLUTION-DATA-REVISION:2020-04-23T17:43:39.112248Z(2) | ||
BEGIN:VTIMEZONE | ||
TZID:W. Europe Standard Time | ||
BEGIN:STANDARD | ||
DTSTART:16010101T030000 | ||
TZOFFSETFROM:+0200 | ||
TZOFFSETTO:+0100 | ||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 | ||
END:STANDARD | ||
BEGIN:DAYLIGHT | ||
DTSTART:16010101T020000 | ||
TZOFFSETFROM:+0100 | ||
TZOFFSETTO:+0200 | ||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3 | ||
END:DAYLIGHT | ||
END:VTIMEZONE | ||
|
||
BEGIN:VEVENT | ||
UID:3bbe38c205956551730fc9233525fe268296ec02 | ||
DTSTAMP:20200423T174240Z | ||
DTSTART;TZID=/freeassociation.sourceforge.net/Europe/Berlin: | ||
20200426T140000 | ||
DTEND;TZID=/freeassociation.sourceforge.net/Europe/Berlin: | ||
20200426T143000 | ||
SUMMARY:Reoccur | ||
SEQUENCE:7 | ||
X-LIC-ERROR;X-LIC-ERRORTYPE=VALUE-PARSE-ERROR:No value for DESCRIPTION | ||
property. Removing entire property: | ||
CREATED:20200423T174316Z | ||
LAST-MODIFIED:20200423T174339Z | ||
X-LIC-ERROR;X-LIC-ERRORTYPE=VALUE-PARSE-ERROR:No value for DESCRIPTION | ||
property. Removing entire property: | ||
RRULE:FREQ=DAILY;UNTIL=20200429T000000Z | ||
EXDATE:20200427T120000Z | ||
|
||
END:VEVENT | ||
END:VCALENDAR |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""These tests are for Issue 27 | ||
https://github.com/niccokunzmann/python-recurring-ical-events/issues/27 | ||
""" | ||
|
||
start_date = (2020, 4, 25) | ||
end_date = (2020, 4, 30) | ||
|
||
def print_events(events): | ||
for event in events: | ||
start = event["DTSTART"].dt | ||
duration = event["DTEND"].dt - event["DTSTART"].dt | ||
print("start {} duration {}".format(start, duration)) | ||
|
||
|
||
def test_until_value_with_unknown_timezone_works_with_exdate(calendars): | ||
"""The until value has no time zone attached.""" | ||
events = calendars.issue_27_t1.between(start_date, end_date) | ||
print_events(events) | ||
assert len(events) == 2, "two events, exdate matches one" | ||
|
||
|
||
def test_until_value_with_default_timezone_works_with_exdate(calendars): | ||
"""The until value uses the default time zone.""" | ||
events = calendars.issue_27_t2.between(start_date, end_date) | ||
print_events(events) | ||
assert len(events) == 2, "two events, exdate matches one" | ||
|
||
|
||
|
||
|