Monotone-Parent: bb3480fceb6cb5272d17ac7b9d0999cd0706581b

Monotone-Revision: a5bfd93a503f6042740a0ab88ca339c566d81c1f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-06-01T18:14:17
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-06-01 18:14:17 +00:00
parent 40afb73cc1
commit d544e677e5
8 changed files with 153 additions and 220 deletions
+4 -4
View File
@@ -43,10 +43,10 @@ class WebdavSyncTest(unittest.TestCase):
self.assertEquals(query1.response["status"], 207,
("query1: invalid status code: %d (!= 207)"
% query1.response["status"]))
token_node = query1.xpath_evaluate("/D:multistatus/D:sync-token")[0]
token_node = query1.response["document"].find("{DAV:}sync-token")
# Implicit "assertion": we expect SOGo to return a token node, with a
# non-empty numerical value. Anything else will trigger an exception
token = int(token_node.childNodes[0].nodeValue)
token = int(token_node.text)
self.assertTrue(token > 0)
self.assertTrue(token <= int(query1.start))
@@ -55,8 +55,8 @@ class WebdavSyncTest(unittest.TestCase):
query2 = webdavlib.WebDAVSyncQuery(resource, "1234", [ "getetag" ])
self.client.execute(query2)
self.assertEquals(query2.response["status"], 403)
cond_nodes = query2.xpath_evaluate("/D:error/D:valid-sync-token")
self.assertTrue(len(cond_nodes) > 0,
cond_nodes = query2.response["document"].find("{DAV:}valid-sync-token")
self.assertTrue(cond_nodes is not None,
"expected 'valid-sync-token' condition error")
if __name__ == "__main__":