Monotone-Parent: bc2e0b73706c7db4bb3e9fe93a30a9000e7861df
Monotone-Revision: b10e6433bff6e100acf843ec817f265d473e1a2d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-04-23T22:23:47 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
857635150f
commit
304814b93b
|
@ -1,5 +1,9 @@
|
||||||
2010-04-23 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2010-04-23 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* Tests/Integration/test-webdav.py
|
||||||
|
(WebDAVTest.testPrincipalPropertySearch): new test method for
|
||||||
|
testing the "principal-property-search" REPORT on SOGo.
|
||||||
|
|
||||||
* Tests/Integration/webdavlib.py: added copyright notice
|
* Tests/Integration/webdavlib.py: added copyright notice
|
||||||
(WebDAVPrincipalPropertySearch): new class that handles the
|
(WebDAVPrincipalPropertySearch): new class that handles the
|
||||||
"principal-property-search" REPORT.
|
"principal-property-search" REPORT.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
from config import hostname, port, username, password
|
from config import hostname, port, username, password, subscriber_username
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import utilities
|
import utilities
|
||||||
|
@ -93,6 +93,33 @@ class WebDAVTest(unittest.TestCase):
|
||||||
self._testPropfindURL('/SOGo/dav/%s/freebusy.ifb' % username)
|
self._testPropfindURL('/SOGo/dav/%s/freebusy.ifb' % username)
|
||||||
|
|
||||||
## REPORT
|
## REPORT
|
||||||
|
def testPrincipalPropertySearch(self):
|
||||||
|
"""principal-property-search"""
|
||||||
|
resource = '/SOGo/dav'
|
||||||
|
userInfo = self.dav_utility.fetchUserInfo(username)
|
||||||
|
# subscriber_userInfo = self.dav_utility.fetchUserInfo(subscriber_username)
|
||||||
|
matches = [["{urn:ietf:params:xml:ns:caldav}calendar-home-set",
|
||||||
|
"/SOGo/dav/%s/Calendar" % username]]
|
||||||
|
## the SOGo implementation does not support more than one
|
||||||
|
## property-search at a time:
|
||||||
|
# ["{urn:ietf:params:xml:ns:caldav}calendar-home-set",
|
||||||
|
# "/SOGo/dav/%s/Calendar" % subscriber_username]]
|
||||||
|
query = webdavlib.WebDAVPrincipalPropertySearch(resource, matches,
|
||||||
|
["displayname"])
|
||||||
|
self.client.execute(query)
|
||||||
|
self.assertEquals(query.response["status"], 207)
|
||||||
|
response = query.xpath_evaluate('/D:multistatus/D:response')[0]
|
||||||
|
href = query.xpath_evaluate('D:href', response)[0]
|
||||||
|
self.assertEquals("/SOGo/dav/%s/" % username,
|
||||||
|
href.childNodes[0].nodeValue)
|
||||||
|
displayname = query.xpath_evaluate('/D:multistatus/D:response' \
|
||||||
|
+ '/D:propstat/D:prop' \
|
||||||
|
+ '/D:displayname')[0]
|
||||||
|
value = displayname.nodeValue
|
||||||
|
if value is None:
|
||||||
|
value = ""
|
||||||
|
self.assertEquals(userInfo[0], value)
|
||||||
|
|
||||||
# http://tools.ietf.org/html/rfc3253.html#section-3.8
|
# http://tools.ietf.org/html/rfc3253.html#section-3.8
|
||||||
def testExpandProperty(self):
|
def testExpandProperty(self):
|
||||||
"""expand-property"""
|
"""expand-property"""
|
||||||
|
|
Loading…
Reference in New Issue