Commit 5681145d authored by Rafael Monnerat's avatar Rafael Monnerat Committed by Tomáš Peterka

slapos_cloud: Fix expected message after update of library

The library was updated so the expected message changed.
Update the assertion to verbose more clearly what is wrong.
parent 5bfa31be
...@@ -150,7 +150,7 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin): ...@@ -150,7 +150,7 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin):
current_message_list = self.getMessageList(self.software_instance) current_message_list = self.getMessageList(self.software_instance)
consistency_message = "Connection XML is invalid: Start tag expected, '<' not "\ consistency_message = "Connection XML is invalid: Start tag expected, '<' not "\
"found, line 1, column 1" "found, line 1, column 1 (line 1)"
# test the test: no expected message found # test the test: no expected message found
self.assertFalse(consistency_message in current_message_list) self.assertFalse(consistency_message in current_message_list)
...@@ -167,7 +167,9 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin): ...@@ -167,7 +167,9 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin):
# if available shall be correct XML # if available shall be correct XML
self.software_instance.edit(connection_xml='this is bad xml') self.software_instance.edit(connection_xml='this is bad xml')
self.assertTrue(consistency_message in self.getMessageList(self.software_instance)) self.assertTrue(consistency_message in self.getMessageList(self.software_instance),
"'%s' is not in '%s'" % (consistency_message,
self.getMessageList(self.software_instance)))
self.software_instance.edit(connection_xml=self.generateEmptyXml()) self.software_instance.edit(connection_xml=self.generateEmptyXml())
self.assertFalse(consistency_message in self.getMessageList(self.software_instance)) self.assertFalse(consistency_message in self.getMessageList(self.software_instance))
...@@ -270,7 +272,7 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin): ...@@ -270,7 +272,7 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin):
current_message_list = self.getMessageList(self.software_instance) current_message_list = self.getMessageList(self.software_instance)
consistency_message = "Sla XML is invalid: Start tag expected, '<' not "\ consistency_message = "Sla XML is invalid: Start tag expected, '<' not "\
"found, line 1, column 1" "found, line 1, column 1 (line 1)"
# test the test: no expected message found # test the test: no expected message found
self.assertFalse(consistency_message in current_message_list) self.assertFalse(consistency_message in current_message_list)
...@@ -287,7 +289,9 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin): ...@@ -287,7 +289,9 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin):
# if available shall be correct XML # if available shall be correct XML
self.software_instance.edit(sla_xml='this is bad xml') self.software_instance.edit(sla_xml='this is bad xml')
self.assertTrue(consistency_message in self.getMessageList(self.software_instance)) self.assertTrue(consistency_message in self.getMessageList(self.software_instance),
"'%s' is not in '%s'" % (consistency_message,
self.getMessageList(self.software_instance)))
self.software_instance.edit(sla_xml=self.generateEmptyXml()) self.software_instance.edit(sla_xml=self.generateEmptyXml())
self.assertFalse(consistency_message in self.getMessageList(self.software_instance)) self.assertFalse(consistency_message in self.getMessageList(self.software_instance))
...@@ -298,7 +302,7 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin): ...@@ -298,7 +302,7 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin):
current_message_list = self.getMessageList(self.software_instance) current_message_list = self.getMessageList(self.software_instance)
consistency_message = "Instance XML is invalid: Start tag expected, '<' not "\ consistency_message = "Instance XML is invalid: Start tag expected, '<' not "\
"found, line 1, column 1" "found, line 1, column 1 (line 1)"
# test the test: no expected message found # test the test: no expected message found
self.assertFalse(consistency_message in current_message_list) self.assertFalse(consistency_message in current_message_list)
...@@ -315,7 +319,9 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin): ...@@ -315,7 +319,9 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin):
# if available shall be correct XML # if available shall be correct XML
self.software_instance.edit(text_content='this is bad xml') self.software_instance.edit(text_content='this is bad xml')
self.assertTrue(consistency_message in self.getMessageList(self.software_instance)) self.assertTrue(consistency_message in self.getMessageList(self.software_instance),
"'%s' is not in '%s'" % (consistency_message,
self.getMessageList(self.software_instance)))
self.software_instance.edit(text_content=self.generateEmptyXml()) self.software_instance.edit(text_content=self.generateEmptyXml())
self.assertFalse(consistency_message in self.getMessageList(self.software_instance)) self.assertFalse(consistency_message in self.getMessageList(self.software_instance))
......
...@@ -6,10 +6,22 @@ ...@@ -6,10 +6,22 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>testSlapOSCloudConstraint</string> </value> <value> <string>testSlapOSCloudConstraint</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSCloudConstraint</string> </value> <value> <string>test.erp5.testSlapOSCloudConstraint</string> </value>
...@@ -43,13 +55,28 @@ ...@@ -43,13 +55,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -62,7 +89,7 @@ ...@@ -62,7 +89,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -71,7 +98,7 @@ ...@@ -71,7 +98,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment