Support param-filter

This commit is contained in:
Guillaume Ayoub
2016-05-27 14:44:59 +02:00
parent da1363f026
commit fef9f0abc6
3 changed files with 88 additions and 18 deletions

View File

@ -25,6 +25,9 @@ LAST-MODIFIED:20130902T150158Z
DTSTAMP:20130902T150158Z
UID:event
SUMMARY:Event
ORGANIZER:mailto:unclesam@example.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Jane Doe:MAILTO:janedoe@example.com
ATTENDEE;ROLE=REQ-PARTICIPANT;DELEGATED-FROM="MAILTO:bob@host.com";PARTSTAT=ACCEPTED;CN=John Doe:MAILTO:johndoe@example.com
DTSTART;TZID=Europe/Paris:20130902T180000
DTEND;TZID=Europe/Paris:20130902T190000
END:VEVENT

View File

@ -217,7 +217,7 @@ class BaseRequests:
</C:comp-filter>"""])
def test_text_match_filter(self):
"""Report request with tag-based filter on calendar."""
"""Report request with text-match filter on calendar."""
assert "href>/calendar.ics/event.ics</" in self._test_filter(["""
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
@ -251,6 +251,51 @@ class BaseRequests:
</C:comp-filter>
</C:comp-filter>"""])
def test_param_filter(self):
"""Report request with param-filter on calendar."""
assert "href>/calendar.ics/event.ics</" in self._test_filter(["""
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:prop-filter name="ATTENDEE">
<C:param-filter name="PARTSTAT">
<C:text-match collation="i;ascii-casemap"
>ACCEPTED</C:text-match>
</C:param-filter>
</C:prop-filter>
</C:comp-filter>
</C:comp-filter>"""])
assert "href>/calendar.ics/event.ics</" not in self._test_filter(["""
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:prop-filter name="ATTENDEE">
<C:param-filter name="PARTSTAT">
<C:text-match collation="i;ascii-casemap"
>UNKNOWN</C:text-match>
</C:param-filter>
</C:prop-filter>
</C:comp-filter>
</C:comp-filter>"""])
assert "href>/calendar.ics/event.ics</" not in self._test_filter(["""
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:prop-filter name="ATTENDEE">
<C:param-filter name="PARTSTAT">
<C:is-not-defined />
</C:param-filter>
</C:prop-filter>
</C:comp-filter>
</C:comp-filter>"""])
assert "href>/calendar.ics/event.ics</" in self._test_filter(["""
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:prop-filter name="ATTENDEE">
<C:param-filter name="UNKNOWN">
<C:is-not-defined />
</C:param-filter>
</C:prop-filter>
</C:comp-filter>
</C:comp-filter>"""])
class TestMultiFileSystem(BaseRequests, BaseTest):
"""Base class for filesystem tests."""