Handle text-match filters

Related to #33.
This commit is contained in:
Guillaume Ayoub
2016-05-18 20:21:03 +02:00
parent d063e3a370
commit 45576d7474
2 changed files with 51 additions and 7 deletions

View File

@ -216,6 +216,41 @@ class BaseRequests:
</C:comp-filter>
</C:comp-filter>"""])
def test_text_match_filter(self):
"""Report request with tag-based 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="SUMMARY">
<C:text-match>event</C:text-match>
</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="UNKNOWN">
<C:text-match>event</C:text-match>
</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="SUMMARY">
<C:text-match>unknown</C:text-match>
</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="SUMMARY">
<C:text-match negate-condition="yes">event</C:text-match>
</C:prop-filter>
</C:comp-filter>
</C:comp-filter>"""])
class TestMultiFileSystem(BaseRequests, BaseTest):
"""Base class for filesystem tests."""