diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-04-11 11:52:29 +0100 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-04-11 11:52:29 +0100 |
commit | a44f887e6609d46f39c6f4266a175dce1671d2a0 (patch) | |
tree | 18da56c093696b9017eec0d62be44ba25339c797 /pykolab/tests/__init__.py | |
parent | de8818dd793a1b1caff98be0ff03fc3e032f9f92 (diff) | |
download | pykolab-a44f887e6609d46f39c6f4266a175dce1671d2a0.tar.gz |
Pull out auth and conf from becoming multi-instance all over the place. One of each suffices.
Clean up imap module, along with making the imap.cyrus module work better
Diffstat (limited to 'pykolab/tests/__init__.py')
-rw-r--r-- | pykolab/tests/__init__.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/pykolab/tests/__init__.py b/pykolab/tests/__init__.py index 554b214..fba8133 100644 --- a/pykolab/tests/__init__.py +++ b/pykolab/tests/__init__.py @@ -23,16 +23,19 @@ import os import random import time -from pykolab.conf import Conf +import pykolab + from pykolab.constants import * from pykolab.tests.constants import * from pykolab.translate import _ +log = pykolab.getLogger('pykolab.tests') +conf = pykolab.getConf() + class Tests(object): def __init__(self): - self.conf = Conf() - test_group = self.conf.parser.add_option_group(_("Test Options")) + test_group = conf.add_cli_parser_option_group(_("Test Options")) for item in TEST_ITEMS: test_group.add_option( "--%s" %(item['name']), @@ -48,7 +51,7 @@ class Tests(object): help = _("Run tests in suite SUITE. Implies a certain set of items being tested."), metavar = "SUITE") - delivery_group = self.conf.parser.add_option_group(_("Content Delivery Options")) + delivery_group = conf.add_cli_parser_option_group(_("Content Delivery Options")) delivery_group.add_option( "--use-mail", dest = "use_mail", @@ -60,21 +63,21 @@ class Tests(object): dest = "use_imap", action = "store_true", default = False, - help = _("Inject messages containing the items through IMAP (requires imaplib)")) + help = _("Inject messages containing the items through IMAP")) delivery_group.add_option( "--use-lmtp", dest = "use_lmtp", action = "store_true", default = False, - help = _("Deliver messages containing the items through LMTP (requires imaplib)")) + help = _("Deliver messages containing the items through LMTP")) - self.conf.finalize_conf() + conf.finalize_conf() def run(self): # Execute the suites first. - for suite in self.conf.test_suites: + for suite in conf.test_suites: try: exec("from pykolab.tests.%s import %sTest" %(suite,suite.capitalize())) - exec("%stest = %sTest(self.conf)" %(suite,suite.capitalize())) + exec("%stest = %sTest()" %(suite,suite.capitalize())) except ImportError, e: - self.conf.log.error(_("Tests for suite %s failed to load. Aborting.") %(suite.capitalize()), recoverable=False) + conf.log.error(_("Tests for suite %s failed to load. Aborting.") %(suite.capitalize()), recoverable=False) |