Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from tobixen/97-wip
97 wip
- Loading branch information
Showing
6 changed files
with
204 additions
and
31 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
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,15 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//Example Corp.//CalDAV Client//EN | ||
BEGIN:VJOURNAL | ||
UID:19920901T130000Z-123409@host.com | ||
DTSTAMP:19920901T130000Z | ||
DTSTART:19920420 | ||
SUMMARY:Yearly Income Tax Report | ||
DESCRIPTION:We made it this year too. Probably. What's the point of a recurring journal entry? Journals are supposed to describe past events, aren't they? | ||
RRULE:FREQ=YEARLY | ||
CLASS:CONFIDENTIAL | ||
CATEGORIES:FAMILY,FINANCE | ||
PRIORITY:1 | ||
END:VJOURNAL | ||
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,15 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//Example Corp.//CalDAV Client//EN | ||
BEGIN:VTODO | ||
UID:19920901T130000Z-123408@host.com | ||
DTSTAMP:19920901T130000Z | ||
DTSTART:19920415T133000Z | ||
DUE:19920516T045959Z | ||
SUMMARY:Yearly Income Tax Preparation | ||
RRULE:FREQ=YEARLY | ||
CLASS:CONFIDENTIAL | ||
CATEGORIES:FAMILY,FINANCE | ||
PRIORITY:1 | ||
END:VTODO | ||
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,14 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//Example Corp.//CalDAV Client//EN | ||
BEGIN:VTODO | ||
UID:19920901T130000Z-123408@host.com | ||
DTSTAMP:19920901T130000Z | ||
DUE:19920516T045959Z | ||
SUMMARY:Yearly Income Tax Preparation | ||
RRULE:FREQ=YEARLY | ||
CLASS:CONFIDENTIAL | ||
CATEGORIES:FAMILY,FINANCE | ||
PRIORITY:1 | ||
END:VTODO | ||
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,44 @@ | ||
import pytest | ||
from recurring_ical_events import DATE_MAX | ||
|
||
calendars_parametrized = pytest.mark.parametrize("ical_file", [ | ||
"issue_97_simple_todo", | ||
"issue_97_simple_journal", | ||
"issue_97_todo_nodtstart", | ||
]) | ||
|
||
@calendars_parametrized | ||
def test_recurring_task_is_not_included1(calendars, ical_file): | ||
"""The three files given starts in late 1991, no recurrences | ||
should be found before 1991. Refers to | ||
https://github.com/niccokunzmann/python-recurring-ical-events/issues/97. | ||
Test passes prior to fixing #97, should still pass after #97 is | ||
fixed. | ||
""" | ||
calendar = getattr(calendars, ical_file) | ||
tasks = calendar.between((1989, 1, 1), (1991,1,1)) | ||
assert not tasks | ||
|
||
@calendars_parametrized | ||
def test_recurring_task_is_not_included2(calendars, ical_file): | ||
"""Every recurrence of the three ical files is in October, hence | ||
no recurrences should be found. Refers to | ||
https://github.com/niccokunzmann/python-recurring-ical-events/issues/97. | ||
Test passes prior to fixing #97, should still pass after #97 is | ||
fixed. | ||
""" | ||
calendar = getattr(calendars, ical_file) | ||
tasks = calendar.between((1998, 1, 1), (1998,4,14)) | ||
assert not tasks | ||
|
||
@calendars_parametrized | ||
def test_recurring_task_is_repeated(calendars, ical_file): | ||
"""Expansion of a yearly task over seven years. | ||
The issue | ||
https://github.com/niccokunzmann/python-recurring-ical-events/issues/97 | ||
needs to be fixed before this test can pass | ||
""" | ||
calendar = getattr(calendars, ical_file) | ||
events = calendar.between((1995, 1, 1), (2002,1,1)) | ||
assert len(events) == 7 | ||
|
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