Commit 2cb6483a authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_configurator: Extra assertions and update tests names.

   This helps to figure out what it is really testing.
parent 4489e56f
...@@ -43,7 +43,8 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin): ...@@ -43,7 +43,8 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
def testConfiguredShacacheWebSite(self): def testConfiguredShacacheWebSite(self):
""" Make sure Shacache WebSite is setuped by Alarm """ Make sure Shacache WebSite is setuped by Alarm
case we trust on promise outcome.""" case we trust on promise outcome, this checks:
WebSiteModule_checkShacacheConstraint """
self.assertEqual(self.portal.web_site_module.checkConsistency(), []) self.assertEqual(self.portal.web_site_module.checkConsistency(), [])
def testConfiguredCacheViaConstraint(self): def testConfiguredCacheViaConstraint(self):
...@@ -54,7 +55,13 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin): ...@@ -54,7 +55,13 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
def testConfiguredConversionServerViaConstraint(self): def testConfiguredConversionServerViaConstraint(self):
""" Make sure Conversion Server was configured well, """ Make sure Conversion Server was configured well,
invoking checkConsistency """ invoking checkConsistency """
self.assertEqual(self.portal.portal_preferences.checkConsistency(), []) pref_tool = self.portal.portal_preferences
self.assertEqual(pref_tool.checkConsistency(), [])
# Check if configuration is properly set:
self.assertEqual(
pref_tool.slapos_default_system_preference.SystemPreference_checkSystemPreferenceConsistency(),
[])
def testConfiguredCertificateAuthoringConstraint(self): def testConfiguredCertificateAuthoringConstraint(self):
"""Make sure Certificate Authoring was configured well, """Make sure Certificate Authoring was configured well,
...@@ -81,9 +88,9 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin): ...@@ -81,9 +88,9 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
self.assertEqual([], self.assertEqual([],
self.portal.portal_templates.TemplateTool_checkBusinessApplicationToModuleConsistency()) self.portal.portal_templates.TemplateTool_checkBusinessApplicationToModuleConsistency())
def testConfiguredConversionServer(self): def test_SystemPreference_checkConversionServerConsistency(self):
""" Make sure Conversion Server (Cloudooo) is """ Make sure Conversion Server (Cloudooo) is
well configured """ well configured."""
# set preference # set preference
preference_tool = self.portal.portal_preferences preference_tool = self.portal.portal_preferences
conversion_url = ["https://cloudooo.erp5.net/"] conversion_url = ["https://cloudooo.erp5.net/"]
...@@ -111,10 +118,19 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin): ...@@ -111,10 +118,19 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
""" Make sure portal_alarms is subscribed. """ """ Make sure portal_alarms is subscribed. """
self.assertTrue(self.portal.portal_alarms.isSubscribed()) self.assertTrue(self.portal.portal_alarms.isSubscribed())
def test_TemplateTool_checkSlapOSPASConsistency(self):
""" Ensure that PAS is configured after the configuration """
self.assertEqual(self.portal.portal_templates.TemplateTool_checkSlapOSPASConsistency(),
[])
self.assertEqual(self.portal.portal_templates.TemplateTool_checkSlapOSPASConsistency(),
[])
def testInteractionDropped(self): def testInteractionDropped(self):
""" Make sure that no portal type uses interaction workflow for simulation """ """ Make sure that no portal type uses interaction workflow for simulation """
for pt in self.portal.portal_types.objectValues(): for pt in self.portal.portal_types.objectValues():
for dropped_workflow in ["delivery_movement_simulation_interaction_workflow", for dropped_workflow in [
"delivery_movement_simulation_interaction_workflow",
"delivery_simulation_interaction_workflow", "delivery_simulation_interaction_workflow",
"open_order_simulation_interaction_workflow", "open_order_simulation_interaction_workflow",
"open_order_path_simulation_interaction_workflow", "open_order_path_simulation_interaction_workflow",
...@@ -126,7 +142,7 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin): ...@@ -126,7 +142,7 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
"Workflow %s still present on %s Portal Type (%s)" % \ "Workflow %s still present on %s Portal Type (%s)" % \
(dropped_workflow, pt, pt.getTypeWorkflowList())) (dropped_workflow, pt, pt.getTypeWorkflowList()))
def testModuleHasIdGeneratorByDay(self): def test_Module_checkSlapOSModuleIdGeneratorConsistency(self):
""" Ensure the Constraint sets appropriate id generator on all modules. """ Ensure the Constraint sets appropriate id generator on all modules.
""" """
module_list = [module.getId() for module in self.portal.objectValues() module_list = [module.getId() for module in self.portal.objectValues()
...@@ -260,6 +276,9 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin): ...@@ -260,6 +276,9 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
self.assertSameSet(module_list, expected_module_list) self.assertSameSet(module_list, expected_module_list)
self.assertEqual(self.portal.portal_simulation.getIdGenerator(), "_generatePerDayId")
self.assertEqual(self.portal.portal_activities.getIdGenerator(), "_generatePerDayId")
def testConfiguredBusinessTemplateList(self): def testConfiguredBusinessTemplateList(self):
""" Make sure Installed business Templates are """ Make sure Installed business Templates are
what it is expected. """ what it is expected. """
...@@ -288,4 +307,4 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin): ...@@ -288,4 +307,4 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
bt5_list = [i[1] for i in self.portal.portal_templates.resolveBusinessTemplateListDependency( bt5_list = [i[1] for i in self.portal.portal_templates.resolveBusinessTemplateListDependency(
template_title_list=bt5_to_resolve, template_title_list=bt5_to_resolve,
with_test_dependency_list=True)] with_test_dependency_list=True)]
self.assertSameSet(expected_business_template_list, bt5_list) self.assertSameSet(expected_business_template_list, bt5_list)
\ No newline at end of file
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