Skip to content
Snippets Groups Projects

Developer documentation for the development of plugins

Merged Adham Hashibon requested to merge developer-documentation into master
4 files
+ 77
22
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -5,6 +5,7 @@ from force_bdss.core.input_slot_info import InputSlotInfo
from force_bdss.core.output_slot_info import OutputSlotInfo
from force_bdss.core.verifier import verify_workflow
from force_bdss.core.workflow import Workflow
from force_bdss.core.kpi_specification import KPISpecification
from force_bdss.tests.dummy_classes.extension_plugin import \
DummyExtensionPlugin
@@ -33,7 +34,7 @@ class TestVerifier(unittest.TestCase):
self.assertEqual(errors[0].subject, wf.mco)
self.assertIn("no defined parameters", errors[0].error)
def test_parameters_empty_names(self):
def test_empty_parameter_options(self):
wf = self.workflow
mco_factory = self.plugin.mco_factories[0]
wf.mco = mco_factory.create_model()
@@ -43,9 +44,39 @@ class TestVerifier(unittest.TestCase):
errors = verify_workflow(wf)
self.assertEqual(len(errors), 3)
self.assertEqual(errors[0].subject, wf.mco.parameters[0])
self.assertIn("empty name", errors[0].error)
self.assertIn("Empty Name", errors[0].error)
self.assertEqual(errors[1].subject, wf.mco.parameters[0])
self.assertIn("empty type", errors[1].error)
self.assertIn("Empty Type", errors[1].error)
def test_empty_kpi_options(self):
wf = self.workflow
mco_factory = self.plugin.mco_factories[0]
wf.mco = mco_factory.create_model()
kpi = KPISpecification(name='', objective='')
wf.mco.kpis.append(kpi)
errors = verify_workflow(wf)
self.assertEqual(len(errors), 4)
self.assertEqual(errors[1].subject, wf.mco.kpis[0])
self.assertIn("Empty Name", errors[1].error)
self.assertIn("Empty Objective", errors[2].error)
def test_empty_execution_layer(self):
wf = self.workflow
mco_factory = self.plugin.mco_factories[0]
wf.mco = mco_factory.create_model()
parameter_factory = mco_factory.parameter_factories()[0]
wf.mco.parameters.append(parameter_factory.create_model())
wf.mco.parameters[0].name = "name"
wf.mco.parameters[0].type = "type"
layer = ExecutionLayer()
wf.execution_layers.append(layer)
errors = verify_workflow(wf)
self.assertEqual(len(errors), 1)
self.assertEqual(errors[0].subject, wf.execution_layers[0])
self.assertIn("Layer 0 has no data sources", errors[0].error)
def test_data_sources(self):
wf = self.workflow
Loading