--
MikealRogers - 19 Jul 2006
Broadsword -- DAVTest Documentation
Where is DAVTest
DAVTest lives in the tools repository under the broadsword project.
svn co svn+ssh://svn.osafoundation.org/svn/tools/broadsword/trunk/modules/DAVTest.py DAVTest.py
What is DAVTest
DAVTest is the base class for all DAV related test scripts or test tools.
DAVTest inherits from HTTPTest for all it's test framework and transport needs.
What is defined in DAVTest
verifyDAVResponseItems method
Method to verify elements exist and, if specified, verify that all strings in dict are in inelement from each {DAV:}response
f = open('files/reports/limitexpand/2.xml')
report2body = f.read()
self.request('REPORT', self.calpath, body=report2body, headers=self.headers)
self.checkStatus(207)
vcalitems = ['BEGIN:VCALENDAR', 'CALSCALE:GREGORIAN', 'PRODID:', 'VERSION:2.0', 'BEGIN:VTIMEZONE',
'LAST-MODIFIED:','TZID:', 'BEGIN:DAYLIGHT', 'DTSTART:', 'RRULE:', 'TZNAME:EDT',
'TZOFFSETFROM', 'TZOFFSETTO', 'END:DAYLIGHT', 'BEGIN:STANDARD', 'DTSTART:', 'RRULE:',
'TZNAME:', 'TZOFFSETFROM:', 'TZOFFSETTO:', 'END:STANDARD', 'END:VTIMEZONE', 'BEGIN:VEVENT',
'DTSTAMP:', 'DTSTART;', 'DURATION:', 'RRULE:', 'SUMMARY:', 'UID:', 'END:VEVENT', 'END:VCALENDAR']
#Check response elements for each response and verify the calendar-data element has the proper UID for each ics entry
self.verifyDAVResponseItems(['5.ics', '6.ics', '7.ics'], inelement='{DAV:}getetag', positive=[''])
self.verifyDAVResponseItems(['5.ics', '6.ics', '7.ics'], inelement='{urn:ietf:params:xml:ns:caldav}calendar-data', positive=vcalitems)
self.verifyDAVResponseInElement('5.ics', '{urn:ietf:params:xml:ns:caldav}calendar-data', negative=['RECURRENCE-ID;'])
verifyDAVResponseInElement method
Method to verify positive and/or negative string list exists in single response.element match
f = open('files/reports/limitexpand/2.xml')
report2body = f.read()
self.request('REPORT', self.calpath, body=report2body, headers=self.headers)
self.checkStatus(207)
vcalitems = ['BEGIN:VCALENDAR', 'CALSCALE:GREGORIAN', 'PRODID:', 'VERSION:2.0', 'BEGIN:VTIMEZONE',
'LAST-MODIFIED:','TZID:', 'BEGIN:DAYLIGHT', 'DTSTART:', 'RRULE:', 'TZNAME:EDT',
'TZOFFSETFROM', 'TZOFFSETTO', 'END:DAYLIGHT', 'BEGIN:STANDARD', 'DTSTART:', 'RRULE:',
'TZNAME:', 'TZOFFSETFROM:', 'TZOFFSETTO:', 'END:STANDARD', 'END:VTIMEZONE', 'BEGIN:VEVENT',
'DTSTAMP:', 'DTSTART;', 'DURATION:', 'RRULE:', 'SUMMARY:', 'UID:', 'END:VEVENT', 'END:VCALENDAR']
#Check response elements for each response and verify the calendar-data element has the proper UID for each ics entry
self.verifyDAVResponseItems(['5.ics', '6.ics', '7.ics'], inelement='{DAV:}getetag', positive=[''])
self.verifyDAVResponseItems(['5.ics', '6.ics', '7.ics'], inelement='{urn:ietf:params:xml:ns:caldav}calendar-data', positive=vcalitems)
self.verifyDAVResponseInElement('5.ics', '{urn:ietf:params:xml:ns:caldav}calendar-data', negative=['RECURRENCE-ID;'])