From 80b4ca09bf4a815efd0726b96e3d032f76e1366d Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 22 Aug 2012 16:54:49 -0400 Subject: do not require a priority attribute on InfoXML files at all --- testsuite/Testlib/TestServer/TestPlugin.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'testsuite/Testlib/TestServer') 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) -- cgit v1.2.3-1-g7c22