diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-10-02 11:55:49 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-10-02 11:55:49 -0400 |
commit | 26c906478fc8cbb74929e929c822cd7e24de4e35 (patch) | |
tree | 1da606ec7e1a7259cd167595e7c84d36446b03d0 /testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py | |
parent | 378575687532d10915dc0327389c953281d7a2ba (diff) | |
download | bcfg2-26c906478fc8cbb74929e929c822cd7e24de4e35.tar.gz bcfg2-26c906478fc8cbb74929e929c822cd7e24de4e35.tar.bz2 bcfg2-26c906478fc8cbb74929e929c822cd7e24de4e35.zip |
testsuite: unit tests for Cfg plugin and base handlers
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py index db8ee0cca..f03ac2fd7 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py @@ -17,16 +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 +from common import XI_NAMESPACE, XI, call, builtins, skip, skipIf, \ + skipUnless, Bcfg2TestCase, patchIf, datastore, inPy3k, can_skip, re_type from TestServer.TestPlugin.Testbase import TestPlugin, TestDebuggable from TestServer.TestPlugin.Testinterfaces import TestGenerator -try: - re_type = re._pattern_type -except AttributeError: - re_type = type(re.compile("")) - def tostring(el): return lxml.etree.tostring(el, xml_declaration=False).decode('UTF-8') @@ -1349,6 +1344,9 @@ class TestSpecificData(Bcfg2TestCase): specific = Mock() return self.test_obj(name, specific, encoding) + def test__init(self): + pass + @patch("%s.open" % builtins) def test_handle_event(self, mock_open): event = Mock() @@ -1783,7 +1781,7 @@ class TestGroupSpool(TestPlugin, TestGenerator): self.assertItemsEqual(gs.Entries, {gs.entry_type: {}}) inner() - + @patch("os.path.isdir") @patch("os.path.isfile") def test_add_entry(self, mock_isfile, mock_isdir): |