[CalendarServer-changes] [10649] CalDAVTester/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Feb 5 09:06:04 PST 2013
Revision: 10649
http://trac.calendarserver.org//changeset/10649
Author: cdaboo at apple.com
Date: 2013-02-05 09:06:04 -0800 (Tue, 05 Feb 2013)
Log Message:
-----------
Test for no properties returned when using Prefer: return=minimal.
Modified Paths:
--------------
CalDAVTester/trunk/scripts/tests/CalDAV/brief.xml
CalDAVTester/trunk/scripts/tests/CalDAV/prefer.xml
CalDAVTester/trunk/verifiers/propfindItems.py
Added Paths:
-----------
CalDAVTester/trunk/Resource/CalDAV/brief/4.xml
CalDAVTester/trunk/Resource/CalDAV/brief/5.xml
CalDAVTester/trunk/Resource/CalDAV/brief/6.xml
CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/5.xml
CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/6.xml
CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/7.xml
Added: CalDAVTester/trunk/Resource/CalDAV/brief/4.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/brief/4.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/brief/4.xml 2013-02-05 17:06:04 UTC (rev 10649)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:propfind xmlns:D="DAV:">
+<D:prop>
+<D:bogus/>
+</D:prop>
+</D:propfind>
Added: CalDAVTester/trunk/Resource/CalDAV/brief/5.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/brief/5.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/brief/5.xml 2013-02-05 17:06:04 UTC (rev 10649)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<C:calendar-multiget xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
+<D:prop>
+<D:bogus/>
+</D:prop>
+<D:href>$calendarpath1:/1.ics</D:href>
+</C:calendar-multiget>
Added: CalDAVTester/trunk/Resource/CalDAV/brief/6.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/brief/6.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/brief/6.xml 2013-02-05 17:06:04 UTC (rev 10649)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
+<D:prop>
+<D:bogus/>
+</D:prop>
+<C:filter>
+<C:comp-filter name="VCALENDAR">
+<C:comp-filter name="VEVENT">
+<C:time-range start="$now.year.1:0101T000000Z" end="$now.year.1:0102T000000Z"/>
+</C:comp-filter>
+</C:comp-filter>
+</C:filter>
+</C:calendar-query>
Added: CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/5.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/5.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/5.xml 2013-02-05 17:06:04 UTC (rev 10649)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:propfind xmlns:D="DAV:">
+<D:prop>
+<D:bogus/>
+</D:prop>
+</D:propfind>
Added: CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/6.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/6.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/6.xml 2013-02-05 17:06:04 UTC (rev 10649)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<C:calendar-multiget xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
+<D:prop>
+<D:bogus/>
+</D:prop>
+<D:href>$calendarpath1:/1.ics</D:href>
+</C:calendar-multiget>
Added: CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/7.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/7.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/prefer/minimal/7.xml 2013-02-05 17:06:04 UTC (rev 10649)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
+<D:prop>
+<D:bogus/>
+</D:prop>
+<C:filter>
+<C:comp-filter name="VCALENDAR">
+<C:comp-filter name="VEVENT">
+<C:time-range start="$now.year.1:0101T000000Z" end="$now.year.1:0102T000000Z"/>
+</C:comp-filter>
+</C:comp-filter>
+</C:filter>
+</C:calendar-query>
Modified: CalDAVTester/trunk/scripts/tests/CalDAV/brief.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/brief.xml 2013-02-05 00:40:53 UTC (rev 10648)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/brief.xml 2013-02-05 17:06:04 UTC (rev 10649)
@@ -148,6 +148,31 @@
</verify>
</request>
</test>
+ <test name='5'>
+ <description>PROPFIND depth=0 with brief=t no results</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$calendarpath1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <header>
+ <name>Brief</name>
+ <value>t</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/brief/4.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ </arg>
+ </verify>
+ </request>
+ </test>
</test-suite>
<test-suite name='multiget'>
@@ -247,6 +272,27 @@
</verify>
</request>
</test>
+ <test name='5'>
+ <description>REPORT with brief=t no results</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarpath1:/</ruri>
+ <header>
+ <name>Brief</name>
+ <value>t</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/brief/5.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ </arg>
+ </verify>
+ </request>
+ </test>
</test-suite>
<test-suite name='query'>
@@ -346,6 +392,27 @@
</verify>
</request>
</test>
+ <test name='5'>
+ <description>REPORT with brief=t no results</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarpath1:/</ruri>
+ <header>
+ <name>Brief</name>
+ <value>t</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/brief/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ </arg>
+ </verify>
+ </request>
+ </test>
</test-suite>
<end/>
Modified: CalDAVTester/trunk/scripts/tests/CalDAV/prefer.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/prefer.xml 2013-02-05 00:40:53 UTC (rev 10648)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/prefer.xml 2013-02-05 17:06:04 UTC (rev 10649)
@@ -131,6 +131,31 @@
</verify>
</request>
</test>
+ <test name='4'>
+ <description>PROPFIND depth=0 with Prefer:return=minimal nothing returned</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$calendarpath1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <header>
+ <name>Prefer</name>
+ <value>return=minimal</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/prefer/minimal/5.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ </arg>
+ </verify>
+ </request>
+ </test>
</test-suite>
<test-suite name='minimal: multiget'>
@@ -207,6 +232,27 @@
</verify>
</request>
</test>
+ <test name='4'>
+ <description>REPORT with Prefer=return=minimal no results</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarpath1:/</ruri>
+ <header>
+ <name>Prefer</name>
+ <value>return=minimal</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/prefer/minimal/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ </arg>
+ </verify>
+ </request>
+ </test>
</test-suite>
<test-suite name='minimal: query'>
@@ -283,6 +329,27 @@
</verify>
</request>
</test>
+ <test name='4'>
+ <description>REPORT with Prefer=return=minimal no results</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarpath1:/</ruri>
+ <header>
+ <name>Prefer</name>
+ <value>return=minimal</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/prefer/minimal/7.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ </arg>
+ </verify>
+ </request>
+ </test>
</test-suite>
<test-suite name='minimal: proppatch'>
Modified: CalDAVTester/trunk/verifiers/propfindItems.py
===================================================================
--- CalDAVTester/trunk/verifiers/propfindItems.py 2013-02-05 00:40:53 UTC (rev 10648)
+++ CalDAVTester/trunk/verifiers/propfindItems.py 2013-02-05 17:06:04 UTC (rev 10649)
@@ -23,7 +23,18 @@
from StringIO import StringIO
class Verifier(object):
+ """
+ Arguments for verifier:
+ ignore: list of hrefs to ignore
+ only: list of specific hrefs to test, others ignored
+ count: match the number of href elements
+ root-element: Qname for the root element of the response
+ status: test the overall response status code (default: 207)
+ okprops: list of properties with propstat status of 200 to test
+ badprops: list of properties with propstat status of 4xx to test
+ """
+
def verify(self, manager, uri, response, respdata, args): #@UnusedVariable
# If no status verification requested, then assume all 2xx codes are OK
@@ -144,8 +155,6 @@
# Get properties for this propstat
prop = props.find("{DAV:}prop")
- if len(prop) == 0:
- return False, " Wrong number of DAV:prop elements\n"
for child in prop.getchildren():
fqname = child.tag
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130205/8f1dde6a/attachment-0001.html>
More information about the calendarserver-changes
mailing list