From 1a3ced3f45423d79e08ca7d861e8118e8618d3b2 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 5 Oct 2012 11:57:16 -0400 Subject: wrote more detailed unit testing documentation --- testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py | 3 +-- testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testexceptions.py | 3 +-- testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py | 7 ++++--- testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testinterfaces.py | 3 +-- 4 files changed, 7 insertions(+), 9 deletions(-) (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugin') diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py index 4b2f1981f..7ee3697bb 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testbase.py @@ -13,8 +13,7 @@ while path != '/': if os.path.basename(path) == "testsuite": break path = os.path.dirname(path) -from common import call, builtins, skip, skipIf, skipUnless, Bcfg2TestCase, \ - patchIf, datastore +from common import * class TestDebuggable(Bcfg2TestCase): diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testexceptions.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testexceptions.py index d2b72251e..916ce822d 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testexceptions.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testexceptions.py @@ -12,8 +12,7 @@ while path != '/': if os.path.basename(path) == "testsuite": break path = os.path.dirname(path) -from common import call, builtins, skip, skipIf, skipUnless, Bcfg2TestCase, \ - patchIf, datastore +from common import * class TestPluginInitError(Bcfg2TestCase): diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py index 27d726fbb..8a1d5a949 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py @@ -17,11 +17,11 @@ while path != '/': if os.path.basename(path) == "testsuite": break path = os.path.dirname(path) -from common import XI_NAMESPACE, XI, call, builtins, skip, skipIf, \ - skipUnless, Bcfg2TestCase, patchIf, datastore, inPy3k, can_skip, re_type +from common import * from TestServer.TestPlugin.Testbase import TestPlugin, TestDebuggable from TestServer.TestPlugin.Testinterfaces import TestGenerator + def tostring(el): return lxml.etree.tostring(el, xml_declaration=False).decode('UTF-8') @@ -155,12 +155,13 @@ class TestDirectoryBacked(Bcfg2TestCase): # such thing as a bad event def test_child_interface(self): - # ensure that the child object has the correct interface + """ ensure that the child object has the correct interface """ self.assertTrue(hasattr(self.test_obj.__child__, "HandleEvent")) def get_obj(self, fam=None): if fam is None: fam = Mock() + @patch("%s.%s.add_directory_monitor" % (self.test_obj.__module__, self.test_obj.__name__), Mock()) diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testinterfaces.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testinterfaces.py index 6ef40d385..ace509057 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testinterfaces.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testinterfaces.py @@ -14,8 +14,7 @@ while path != '/': if os.path.basename(path) == "testsuite": break path = os.path.dirname(path) -from common import call, builtins, skip, skipIf, skipUnless, Bcfg2TestCase, \ - patchIf, datastore +from common import * from TestServer.TestPlugin.Testbase import TestPlugin -- cgit v1.2.3-1-g7c22