summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-22 16:54:49 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-22 17:08:43 -0400
commit80b4ca09bf4a815efd0726b96e3d032f76e1366d (patch)
tree7dcb9df1d84193388748874bb3bd1d86cb9606aa /testsuite
parent861ac7ceee27c263c024eaf76941c0ab711bf8ba (diff)
downloadbcfg2-80b4ca09bf4a815efd0726b96e3d032f76e1366d.tar.gz
bcfg2-80b4ca09bf4a815efd0726b96e3d032f76e1366d.tar.bz2
bcfg2-80b4ca09bf4a815efd0726b96e3d032f76e1366d.zip
do not require a priority attribute on InfoXML files at all
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/Testlib/TestServer/TestPlugin.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/testsuite/Testlib/TestServer/TestPlugin.py b/testsuite/Testlib/TestServer/TestPlugin.py
index f970fcdb1..14e37f36b 100644
--- a/testsuite/Testlib/TestServer/TestPlugin.py
+++ b/testsuite/Testlib/TestServer/TestPlugin.py
@@ -1379,16 +1379,20 @@ class TestXMLSrc(TestXMLFileBacked):
xsrc.__node__ = Mock()
mock_open.return_value.read.return_value = tostring(xdata)
- self.assertRaises(PluginExecutionError,
- xsrc.HandleEvent, Mock())
+ if xsrc.__priority_required__:
+ # test with no priority at all
+ self.assertRaises(PluginExecutionError,
+ xsrc.HandleEvent, Mock())
- xdata.set("priority", "cow")
- mock_open.return_value.read.return_value = tostring(xdata)
- self.assertRaises(PluginExecutionError,
- xsrc.HandleEvent, Mock())
+ # test with bogus priority
+ xdata.set("priority", "cow")
+ mock_open.return_value.read.return_value = tostring(xdata)
+ self.assertRaises(PluginExecutionError,
+ xsrc.HandleEvent, Mock())
- xdata.set("priority", "10")
- mock_open.return_value.read.return_value = tostring(xdata)
+ # assign a priority to use in future tests
+ xdata.set("priority", "10")
+ mock_open.return_value.read.return_value = tostring(xdata)
mock_open.reset_mock()
xsrc = self.get_obj("/test/foo.xml")
@@ -1946,8 +1950,7 @@ class TestEntrySet(TestDebuggable):
event = Mock()
event.filename = "info.xml"
eset.update_metadata(event)
- mock_InfoXML.assert_called_with(os.path.join(eset.path, "info.xml"),
- True)
+ mock_InfoXML.assert_called_with(os.path.join(eset.path, "info.xml"))
mock_InfoXML.return_value.HandleEvent.assert_called_with(event)
self.assertEqual(eset.infoxml, mock_InfoXML.return_value)