summaryrefslogtreecommitdiffstats
path: root/testsuite/Testsrc/Testlib/TestServer/TestPlugin
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-01-16 13:28:06 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-01-17 09:25:45 -0500
commitebe7542db7217c2fac3d7111e80f94caedfb69e2 (patch)
tree964db7ae511795d80b3ae50f3e14bc9f3344756a /testsuite/Testsrc/Testlib/TestServer/TestPlugin
parentae58c24f72a8ed72327fbc3f7305bd69ec6a13db (diff)
downloadbcfg2-ebe7542db7217c2fac3d7111e80f94caedfb69e2.tar.gz
bcfg2-ebe7542db7217c2fac3d7111e80f94caedfb69e2.tar.bz2
bcfg2-ebe7542db7217c2fac3d7111e80f94caedfb69e2.zip
added module-level OptionParser to avoid passing it as an argument or global all over
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugin')
-rw-r--r--testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py
index 6dbdc7667..75cc41a34 100644
--- a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py
+++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py
@@ -1716,16 +1716,17 @@ class TestEntrySet(TestDebuggable):
"important: true",
"bogus: line"]
mock_open.return_value.readlines.return_value = idata
+ eset.metadata = default_path_metadata()
eset.update_metadata(event)
- expected = DEFAULT_FILE_METADATA.copy()
+ expected = default_path_metadata()
expected['owner'] = 'owner'
expected['group'] = 'GROUP'
expected['mode'] = '0775'
expected['important'] = 'true'
- self.assertItemsEqual(eset.metadata,
- expected)
+ self.assertItemsEqual(eset.metadata, expected)
- def test_reset_metadata(self):
+ @patch("Bcfg2.Server.Plugin.helpers.default_path_metadata")
+ def test_reset_metadata(self, mock_default_path_metadata):
eset = self.get_obj()
# test info.xml
@@ -1740,7 +1741,8 @@ class TestEntrySet(TestDebuggable):
event.filename = fname
eset.metadata = Mock()
eset.reset_metadata(event)
- self.assertItemsEqual(eset.metadata, DEFAULT_FILE_METADATA)
+ self.assertEqual(eset.metadata,
+ mock_default_path_metadata.return_value)
@patch("Bcfg2.Server.Plugin.helpers.bind_info")
def test_bind_info_to_entry(self, mock_bind_info):