mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-18 09:48:12 +00:00
merge of '087438694b433e2d312278234d9a1776d302326f'
and '6c5c0cfc38476abab3bbd81d781d653717c5be6d' Monotone-Parent: 087438694b433e2d312278234d9a1776d302326f Monotone-Parent: 6c5c0cfc38476abab3bbd81d781d653717c5be6d Monotone-Revision: 6eb182232c54958d95899ac372dfe954dcc1b9f4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-08-07T15:40:42 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
commit
d5efec6e72
6 files changed
+38
-16
No files matched your search
@@ -1,3 +1,9 @@
|
|||||||
|
2009-08-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* Tests/all.py: modified to load and run all the test modules
|
||||||
|
found in the current directory, as long as they are prefixed by
|
||||||
|
"test-".
|
||||||
|
|
||||||
2009-08-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2009-08-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* Tests/davacl.py: new functional testsuite for DAV acls on
|
* Tests/davacl.py: new functional testsuite for DAV acls on
|
||||||
|
|||||||
+15
-5
@@ -1,9 +1,19 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
import unittest
|
import os, unittest
|
||||||
|
|
||||||
from davacl import *
|
|
||||||
from webdavsync import *
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
loader = unittest.TestLoader()
|
||||||
|
modules = []
|
||||||
|
for mod in os.listdir("."):
|
||||||
|
if mod.startswith("test-") and mod.endswith(".py"):
|
||||||
|
modules.append(mod[:-3])
|
||||||
|
__import__(mod[:-3])
|
||||||
|
|
||||||
|
if len(modules) > 0:
|
||||||
|
print "Test modules: '%s'" % "', '".join(modules)
|
||||||
|
suite = loader.loadTestsFromNames(modules)
|
||||||
|
runner = unittest.TextTestRunner()
|
||||||
|
runner.run(suite)
|
||||||
|
else:
|
||||||
|
print "No test available."
|
||||||
File renamed without changes.
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
from testconfig import hostname, port, username, password
|
from config import hostname, port, username, password
|
||||||
|
|
||||||
import webdavlib
|
import webdavlib
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
from testconfig import hostname, port, username, password, subscriber_username, subscriber_password
|
from config import hostname, port, username, password, subscriber_username, subscriber_password
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
@@ -22,11 +22,11 @@ import time
|
|||||||
# d: view date and time
|
# d: view date and time
|
||||||
# m: modify
|
# m: modify
|
||||||
# r: respond
|
# r: respond
|
||||||
# rights = { "c": create,
|
# short rights notation: { "c": create,
|
||||||
# "d": delete,
|
# "d": delete,
|
||||||
# "pu": public,
|
# "pu": public,
|
||||||
# "pr": private,
|
# "pr": private,
|
||||||
# "co": confidential }
|
# "co": confidential }
|
||||||
|
|
||||||
resource = '/SOGo/dav/%s/Calendar/test-dav-acl/' % username
|
resource = '/SOGo/dav/%s/Calendar/test-dav-acl/' % username
|
||||||
|
|
||||||
@@ -103,7 +103,8 @@ class DAVAclTest(unittest.TestCase):
|
|||||||
"C": "urn:ietf:params:xml:ns:caldav" })
|
"C": "urn:ietf:params:xml:ns:caldav" })
|
||||||
return xml.xpath.Evaluate(query, None, xpath_context)
|
return xml.xpath.Evaluate(query, None, xpath_context)
|
||||||
|
|
||||||
def _putEvent(self, client, filename, event_class = "PUBLIC", exp_status = 201):
|
def _putEvent(self, client, filename,
|
||||||
|
event_class = "PUBLIC", exp_status = 201):
|
||||||
url = "%s%s" % (resource, filename)
|
url = "%s%s" % (resource, filename)
|
||||||
event = event_template % { "class": event_class,
|
event = event_template % { "class": event_class,
|
||||||
"filename": filename }
|
"filename": filename }
|
||||||
@@ -179,6 +180,9 @@ class DAVAclTest(unittest.TestCase):
|
|||||||
else:
|
else:
|
||||||
exp_code = 403
|
exp_code = 403
|
||||||
self._deleteEvent(self.subscriber_client, "public.ics", exp_code)
|
self._deleteEvent(self.subscriber_client, "public.ics", exp_code)
|
||||||
|
self._deleteEvent(self.subscriber_client, "private.ics", exp_code)
|
||||||
|
self._deleteEvent(self.subscriber_client, "confidential.ics",
|
||||||
|
exp_code)
|
||||||
|
|
||||||
def _testEventRight(self, event_class, rights):
|
def _testEventRight(self, event_class, rights):
|
||||||
if rights.has_key(event_class):
|
if rights.has_key(event_class):
|
||||||
@@ -210,7 +214,8 @@ class DAVAclTest(unittest.TestCase):
|
|||||||
|
|
||||||
return event
|
return event
|
||||||
|
|
||||||
def _calendarDataInMultistatus(self, top_node, filename, response_tag = "D:response"):
|
def _calendarDataInMultistatus(self, top_node, filename,
|
||||||
|
response_tag = "D:response"):
|
||||||
event = None
|
event = None
|
||||||
|
|
||||||
response_nodes = self._xpath_query("/D:multistatus/%s" % response_tag,
|
response_nodes = self._xpath_query("/D:multistatus/%s" % response_tag,
|
||||||
@@ -310,7 +315,8 @@ class DAVAclTest(unittest.TestCase):
|
|||||||
"PRODID": "-//Inverse//Event Generator//EN",
|
"PRODID": "-//Inverse//Event Generator//EN",
|
||||||
"SEQUENCE": "0",
|
"SEQUENCE": "0",
|
||||||
"TRANSP": "OPAQUE",
|
"TRANSP": "OPAQUE",
|
||||||
"UID": "12345-%s-%s.ics" % (icsClass, icsClass.lower()),
|
"UID": "12345-%s-%s.ics" % (icsClass,
|
||||||
|
icsClass.lower()),
|
||||||
"SUMMARY": "(%s event)" % icsClass.capitalize(),
|
"SUMMARY": "(%s event)" % icsClass.capitalize(),
|
||||||
"DTSTART": "20090805T100000Z",
|
"DTSTART": "20090805T100000Z",
|
||||||
"DTEND": "20090805T140000Z",
|
"DTEND": "20090805T140000Z",
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
from testconfig import hostname, port, username, password
|
from config import hostname, port, username, password
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
Reference in new issue
Block a user