mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-06 09:19:21 +00:00
Monotone-Parent: c40151185171e3ba8a257569b8ab5ec86930d393
Monotone-Revision: 0efdaccbad84f567e4d9cc3ca0176e506620aefb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-05-05T18:49:29 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
2bf4b7cf8b
commit
97df7c4c45
10 files changed
+422
-277
No files matched your search
@@ -37,6 +37,45 @@ def fetchUserInfo(login):
|
||||
|
||||
return (displayName, email_nodes[0].childNodes[0].nodeValue)
|
||||
|
||||
class CalDAVPropertiesTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.client = webdavlib.WebDAVClient(hostname, port,
|
||||
username, password)
|
||||
self.user_calendar = "/SOGo/dav/%s/Calendar/personal/" % username
|
||||
|
||||
def testDavScheduleCalendarTransparency(self):
|
||||
"""{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp"""
|
||||
propfind = webdavlib.WebDAVPROPFIND(self.user_calendar,
|
||||
["{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp"],
|
||||
0)
|
||||
self.client.execute(propfind)
|
||||
propfind.xpath_namespace = { "D": "DAV:",
|
||||
"C": "urn:ietf:params:xml:ns:caldav" }
|
||||
propstats = propfind.xpath_evaluate('/D:multistatus/D:response/D:propstat/D:prop/C:schedule-calendar-transp')
|
||||
self.assertTrue(len(propstats) > 0,
|
||||
"schedule-calendar-transp not present in response")
|
||||
node = propstats[0]
|
||||
status = propfind.xpath_evaluate('D:status',
|
||||
node.parentNode.parentNode)[0] \
|
||||
.childNodes[0].nodeValue[9:12]
|
||||
self.assertEquals(status, "200",
|
||||
"schedule-calendar-transp marked as 'Not Found' in response")
|
||||
values = node.childNodes
|
||||
nvalues = len(values)
|
||||
self.assertEquals(nvalues, 1,
|
||||
"expected 1 value (%d received)" % nvalues)
|
||||
value = values[0]
|
||||
print node.namespaceURI
|
||||
self.assertEquals(value.__class__.__name__, "Element",
|
||||
"schedule-calendar-transp must be an instance of" \
|
||||
" %s, not %s" % ("Element", value.__class__.__name__))
|
||||
self.assertEquals(value.namespaceURI, "urn:ietf:params:xml:ns:caldav",
|
||||
"schedule-calendar-transp must have a value in namespace '%s', not '%s'", "urn:ietf:params:xml:ns:caldav", value.namespaceURI)
|
||||
self.assertTrue(value.tagName == "opaque"
|
||||
or value.tagName == "transparent",
|
||||
"schedule-calendar-transp must be 'opaque' or" \
|
||||
" 'transparent', not '%s'" % value.tagName)
|
||||
|
||||
class CalDAVITIPDelegationTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.client = webdavlib.WebDAVClient(hostname, port,
|
||||
@@ -159,7 +198,7 @@ class CalDAVITIPDelegationTest(unittest.TestCase):
|
||||
% (email,
|
||||
compared_attendees[email], attendees[email]))
|
||||
|
||||
def testInvitationDelegation(self):
|
||||
def xtestInvitationDelegation(self):
|
||||
""" invitation delegation """
|
||||
|
||||
# the invitation must not exist
|
||||
|
||||
@@ -19,8 +19,7 @@ class WebDAVTest(unittest.TestCase):
|
||||
propfind = webdavlib.WebDAVPROPFIND(resource,
|
||||
["{DAV:}principal-collection-set"],
|
||||
0)
|
||||
propfind.xpath_namespace = { "D": "DAV:" }
|
||||
self.client.execute(propfind)
|
||||
propfind.xpath_namespace = { "D": "DAV:" } self.client.execute(propfind)
|
||||
self.assertEquals(propfind.response["status"], 207)
|
||||
nodes = propfind.xpath_evaluate('/D:multistatus/D:response/D:propstat/D:prop/D:principal-collection-set/D:href',
|
||||
None)
|
||||
|
||||
Reference in new issue
Block a user