Monotone-Parent: 16e84a4b9506eba9d39a96290c969eda838704a2
Monotone-Revision: e9d4010d6c952c0aa503fa4571a589fb91c356b5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-07-13T16:02:56 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
d7d107a8cc
commit
10059831ab
|
@ -1,5 +1,10 @@
|
|||
2010-07-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* Tests/Integration/sogotests.py: new module overriding
|
||||
certain methods from the "unittest" module in order to
|
||||
automatically execute the tests in verbose mode and by displaying
|
||||
a timing of the test execution.
|
||||
|
||||
* Tests/Integration/test-webdavsync.py (WebdavSyncTest.test):
|
||||
adapted to suit the new handling of empty collections in SOGo
|
||||
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import os, sys, unittest, getopt, traceback
|
||||
import os, sys, unittest, getopt, traceback, time
|
||||
import preferences
|
||||
import sogotests
|
||||
import unittest
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest._TextTestResult.oldStartTest = unittest._TextTestResult.startTest
|
||||
unittest._TextTestResult.startTest = sogotests.UnitTestTextTestResultNewStartTest
|
||||
unittest._TextTestResult.stopTest = sogotests.UnitTestTextTestResultNewStopTest
|
||||
|
||||
loader = unittest.TestLoader()
|
||||
modules = []
|
||||
# Duplicated from UIxPreferences.m
|
||||
|
@ -28,7 +34,7 @@ if __name__ == "__main__":
|
|||
suite = loader.loadTestsFromNames(modules)
|
||||
print "%d tests in modules: '%s'" % (suite.countTestCases(),
|
||||
"', '".join(modules))
|
||||
runner = unittest.TextTestRunner()
|
||||
runner = unittest.TextTestRunner(verbosity=2)
|
||||
|
||||
if testLanguages:
|
||||
prefs = preferences.preferences()
|
||||
|
@ -49,6 +55,7 @@ if __name__ == "__main__":
|
|||
|
||||
print "Running test in %s (%d/%d)" % \
|
||||
(languages[i], i + 1, len (languages))
|
||||
runner.verbosity = 2
|
||||
runner.run(suite)
|
||||
# Revert to the original language
|
||||
prefs.set ("language", userLanguage)
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
import sys
|
||||
import unittest
|
||||
import time
|
||||
|
||||
def UnitTestTextTestResultNewStartTest(self, test):
|
||||
self.xstartTime = time.time()
|
||||
self.oldStartTest(test)
|
||||
|
||||
def UnitTestTextTestResultNewStopTest(self, test):
|
||||
unittest.TestResult.stopTest(self, test)
|
||||
endTime = time.time()
|
||||
delta = endTime - self.xstartTime
|
||||
print " %f ms" % delta
|
||||
|
||||
def runTests():
|
||||
unittest._TextTestResult.oldStartTest = unittest._TextTestResult.startTest
|
||||
unittest._TextTestResult.startTest = UnitTestTextTestResultNewStartTest
|
||||
unittest._TextTestResult.stopTest = UnitTestTextTestResultNewStopTest
|
||||
|
||||
argv = []
|
||||
argv.extend(sys.argv)
|
||||
argv.append("-v")
|
||||
unittest.main(argv=argv)
|
|
@ -6,14 +6,15 @@
|
|||
from config import hostname, port, username, password, attendee1, attendee1_delegate
|
||||
|
||||
import datetime
|
||||
import sogotests
|
||||
import sys
|
||||
import time
|
||||
import unittest
|
||||
import utilities
|
||||
import vobject
|
||||
import vobject.base
|
||||
import vobject.icalendar
|
||||
import webdavlib
|
||||
import utilities
|
||||
import StringIO
|
||||
import xml.etree.ElementTree
|
||||
|
||||
|
@ -475,4 +476,4 @@ class CalDAVITIPDelegationTest(unittest.TestCase):
|
|||
"%stest-delegation.ics" % self.attendee1_calendar, 404)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
sogotests.runTests()
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
from config import hostname, port, username, password, mailserver, subscriber_username, attendee1, attendee1_delegate
|
||||
|
||||
import sogotests
|
||||
import unittest
|
||||
import time
|
||||
|
||||
class CalDAVITIPDelegationTest(unittest.TestCase):
|
||||
def testConfigPY(self):
|
||||
|
@ -51,4 +53,4 @@ class CalDAVITIPDelegationTest(unittest.TestCase):
|
|||
userHash[user] = True
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
sogotests.runTests()
|
||||
|
|
|
@ -7,6 +7,7 @@ import unittest
|
|||
import webdavlib
|
||||
import time
|
||||
|
||||
import sogotests
|
||||
import utilities
|
||||
|
||||
# TODO:
|
||||
|
@ -941,4 +942,4 @@ class DAVCalendarPublicAclTest(unittest.TestCase):
|
|||
"resource '%s' not returned" % resource)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
sogotests.runTests()
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
from config import hostname, port, username, password, subscriber_username
|
||||
|
||||
import unittest
|
||||
import sogotests
|
||||
import utilities
|
||||
import webdavlib
|
||||
|
||||
|
@ -200,4 +201,4 @@ class iCalTest(unittest.TestCase):
|
|||
client.execute(delete)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
sogotests.runTests()
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
from config import hostname, port, username, password, mailserver, subscriber_username, subscriber_password
|
||||
|
||||
import sys
|
||||
import sogotests
|
||||
import unittest
|
||||
import webdavlib
|
||||
import time
|
||||
|
@ -673,4 +674,4 @@ class DAVMailCollectionTest():
|
|||
self._deleteCollection ("test-dav-mail")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
sogotests.runTests()
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
from config import hostname, port, username, password, subscriber_username
|
||||
|
||||
import sogotests
|
||||
import unittest
|
||||
import utilities
|
||||
import webdavlib
|
||||
|
@ -151,4 +152,4 @@ class WebDAVTest(unittest.TestCase):
|
|||
propDisplayname))
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
sogotests.runTests()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import sogotests
|
||||
import unittest
|
||||
|
||||
from webdavlib import *
|
||||
|
@ -47,4 +48,4 @@ class HTTPUnparsedURLTest(unittest.TestCase):
|
|||
self.assertEquals(testURL.path, "/hooray")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
sogotests.runTests()
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
from config import hostname, port, username, password
|
||||
|
||||
import sys
|
||||
import sogotests
|
||||
import unittest
|
||||
import webdavlib
|
||||
import time
|
||||
|
@ -19,6 +20,7 @@ class WebdavSyncTest(unittest.TestCase):
|
|||
self.client.execute(delete)
|
||||
|
||||
def test(self):
|
||||
"""webdav sync"""
|
||||
# missing tests:
|
||||
# invalid tokens: negative, non-numeric, > current timestamp
|
||||
# non-empty collections: token validity, status codes for added,
|
||||
|
@ -63,4 +65,4 @@ class WebdavSyncTest(unittest.TestCase):
|
|||
self.assertTrue(token > 0)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
sogotests.runTests()
|
||||
|
|
Loading…
Reference in New Issue