debug VTODO and first tests running

This commit is contained in:
Cedric Boscher 2016-06-15 15:45:27 +02:00
parent 7981e67d96
commit a5d5cc8b2c
10 changed files with 116 additions and 7 deletions

View File

@ -304,8 +304,9 @@ def _time_range_match(vobject_item, filter_, child_name):
completed = completed.value completed = completed.value
return start <= completed and end >= completed return start <= completed and end >= completed
elif created is not None: elif created is not None:
# Line 7
created = created.value created = created.value
return end < created return end > created
else: else:
return True return True

View File

@ -20,6 +20,7 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD END:STANDARD
END:VTIMEZONE END:VTIMEZONE
BEGIN:VTODO BEGIN:VTODO
DTSTART;TZID=Europe/Paris:20130901T180000
DURATION:PT1H
END:VTODO END:VTODO
END:VCALENDAR END:VCALENDAR

View File

@ -20,6 +20,7 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD END:STANDARD
END:VTIMEZONE END:VTIMEZONE
BEGIN:VTODO BEGIN:VTODO
DTSTART;TZID=Europe/Paris:20130901T180000
DUE;TZID=Europe/Paris:20130903T180000
END:VTODO END:VTODO
END:VCALENDAR END:VCALENDAR

View File

@ -20,6 +20,6 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD END:STANDARD
END:VTIMEZONE END:VTIMEZONE
BEGIN:VTODO BEGIN:VTODO
DTSTART;TZID=Europe/Paris:20130901T180000
END:VTODO END:VTODO
END:VCALENDAR END:VCALENDAR

View File

@ -20,6 +20,6 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD END:STANDARD
END:VTIMEZONE END:VTIMEZONE
BEGIN:VTODO BEGIN:VTODO
DUE;TZID=Europe/Paris:20130903T180000
END:VTODO END:VTODO
END:VCALENDAR END:VCALENDAR

View File

@ -20,6 +20,7 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD END:STANDARD
END:VTIMEZONE END:VTIMEZONE
BEGIN:VTODO BEGIN:VTODO
CREATED;TZID=Europe/Paris:20130903T180000
COMPLETED;TZID=Europe/Paris:20130920T180000
END:VTODO END:VTODO
END:VCALENDAR END:VCALENDAR

25
tests/static/todo6.ics Normal file
View File

@ -0,0 +1,25 @@
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Paris
X-LIC-LOCATION:Europe/Paris
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VTODO
COMPLETED;TZID=Europe/Paris:20130920T180000
END:VTODO
END:VCALENDAR

25
tests/static/todo7.ics Normal file
View File

@ -0,0 +1,25 @@
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Paris
X-LIC-LOCATION:Europe/Paris
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VTODO
CREATED;TZID=Europe/Paris:20130803T180000
END:VTODO
END:VCALENDAR

25
tests/static/todo8.ics Normal file
View File

@ -0,0 +1,25 @@
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Paris
X-LIC-LOCATION:Europe/Paris
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VTODO
END:VTODO
END:VCALENDAR

View File

@ -371,6 +371,36 @@ class BaseRequests:
assert "href>/calendar.ics/event4.ics</" not in answer assert "href>/calendar.ics/event4.ics</" not in answer
assert "href>/calendar.ics/event5.ics</" not in answer assert "href>/calendar.ics/event5.ics</" not in answer
answer = self._test_filter(["""
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VTODO">
<C:time-range start="20130801T000000Z" end="20131001T000000Z"/>
</C:comp-filter>
</C:comp-filter>"""],"todo", events=8)
assert "href>/calendar.ics/todo1.ics</" in answer
assert "href>/calendar.ics/todo2.ics</" in answer
assert "href>/calendar.ics/todo3.ics</" in answer
assert "href>/calendar.ics/todo4.ics</" in answer
assert "href>/calendar.ics/todo5.ics</" in answer
assert "href>/calendar.ics/todo6.ics</" in answer
assert "href>/calendar.ics/todo7.ics</" in answer
assert "href>/calendar.ics/todo8.ics</" in answer
answer = self._test_filter(["""
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VTODO">
<C:time-range start="20130801T180000Z" end="20130801T000000Z"/>
</C:comp-filter>
</C:comp-filter>"""],"todo", events=8)
assert "href>/calendar.ics/todo1.ics</" not in answer
assert "href>/calendar.ics/todo2.ics</" not in answer
assert "href>/calendar.ics/todo3.ics</" not in answer
assert "href>/calendar.ics/todo4.ics</" not in answer
assert "href>/calendar.ics/todo5.ics</" not in answer
assert "href>/calendar.ics/todo6.ics</" not in answer
assert "href>/calendar.ics/todo7.ics</" not in answer
assert "href>/calendar.ics/todo8.ics</" in answer
class TestMultiFileSystem(BaseRequests, BaseTest): class TestMultiFileSystem(BaseRequests, BaseTest):
"""Base class for filesystem tests.""" """Base class for filesystem tests."""