diff options
Diffstat (limited to 'testsuite/Testsrc')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestTemplateHelper.py | 26 | ||||
-rw-r--r-- | testsuite/Testsrc/test_code_checks.py | 1 |
2 files changed, 16 insertions, 11 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestTemplateHelper.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestTemplateHelper.py index 128d6cae5..1c2fa23a2 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestTemplateHelper.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestTemplateHelper.py @@ -2,6 +2,7 @@ import os import sys import Bcfg2.Server.Plugin from mock import Mock, MagicMock, patch +from Bcfg2.Utils import safe_module_name from Bcfg2.Server.Plugins.TemplateHelper import * # add all parent testsuite directories to sys.path to allow (most) @@ -39,8 +40,9 @@ class TestHelperModule(Bcfg2TestCase): mock_load_source.side_effect = ImportError attrs = dir(hm) hm.HandleEvent() - mock_load_source.assert_called_with(safe_module_name(hm._module_name), - hm.name) + mock_load_source.assert_called_with( + safe_module_name('TemplateHelper', hm._module_name), + hm.name) self.assertEqual(attrs, dir(hm)) self.assertEqual(hm._attrs, []) @@ -51,8 +53,9 @@ class TestHelperModule(Bcfg2TestCase): mock_load_source.return_value = Mock() attrs = dir(hm) hm.HandleEvent() - mock_load_source.assert_called_with(safe_module_name(hm._module_name), - hm.name) + mock_load_source.assert_called_with( + safe_module_name('TemplateHelper', hm._module_name), + hm.name) self.assertEqual(attrs, dir(hm)) self.assertEqual(hm._attrs, []) @@ -63,8 +66,9 @@ class TestHelperModule(Bcfg2TestCase): mock_load_source.return_value = module attrs = dir(hm) hm.HandleEvent() - mock_load_source.assert_called_with(safe_module_name(hm._module_name), - hm.name) + mock_load_source.assert_called_with( + safe_module_name('TemplateHelper', hm._module_name), + hm.name) self.assertEqual(attrs, dir(hm)) self.assertEqual(hm._attrs, []) @@ -74,8 +78,9 @@ class TestHelperModule(Bcfg2TestCase): mock_load_source.reset() mock_load_source.return_value = module hm.HandleEvent() - mock_load_source.assert_called_with(safe_module_name(hm._module_name), - hm.name) + mock_load_source.assert_called_with( + safe_module_name('TemplateHelper', hm._module_name), + hm.name) self.assertTrue(hasattr(hm, "foo")) self.assertTrue(hasattr(hm, "bar")) self.assertTrue(hasattr(hm, "baz")) @@ -87,8 +92,9 @@ class TestHelperModule(Bcfg2TestCase): mock_load_source.reset() mock_load_source.return_value = module hm.HandleEvent() - mock_load_source.assert_called_with(safe_module_name(hm._module_name), - hm.name) + mock_load_source.assert_called_with( + safe_module_name('TemplateHelper', hm._module_name), + hm.name) self.assertTrue(hasattr(hm, "foo")) self.assertTrue(hasattr(hm, "bar")) self.assertTrue(hasattr(hm, "quux")) diff --git a/testsuite/Testsrc/test_code_checks.py b/testsuite/Testsrc/test_code_checks.py index ba4b19d1c..6d3c4c714 100644 --- a/testsuite/Testsrc/test_code_checks.py +++ b/testsuite/Testsrc/test_code_checks.py @@ -66,7 +66,6 @@ error_checks = { "VCS.py", "YUM24.py"], "lib/Bcfg2/Server/Plugins": ["Deps.py", - "Ldap.py", "Pkgmgr.py"] } |