def test_parse_workflows(self): """Test parsing WORKFLOWS.""" from pinball_ext.workflow.parser import PyWorkflowParser params =\ {'workflows_config': 'tests.pinball_ext.workflow.parser_test.WORKFLOWS'} py_workflow_parser = PyWorkflowParser(params) py_workflow_parser.parse_workflows() self.assertEquals(3, len(py_workflow_parser.workflows)) self.assertEquals(2, len( py_workflow_parser.workflows['some_workflow'].jobs)) self.assertEquals(3, len( py_workflow_parser.workflows['some_other_workflow'].jobs)) self.assertEquals(3, len( py_workflow_parser.workflows['another_workflow'].jobs)) self.assertEquals(24 * 60 * 60, py_workflow_parser.workflows['some_workflow']. schedule.recurrence_seconds) self.assertEquals(60 * 60, py_workflow_parser.workflows['some_other_workflow']. schedule.recurrence_seconds) self.assertEquals(60 * 60, py_workflow_parser.workflows['another_workflow']. schedule.recurrence_seconds) self.assertEquals(py_workflow_parser.workflows_config_str, 'tests.pinball_ext.workflow.parser_test.WORKFLOWS')
def test_parse_workflows(self): """Test parsing WORKFLOWS.""" from pinball_ext.workflow.parser import PyWorkflowParser params =\ {'workflows_config': 'tests.pinball_ext.workflow.parser_test.WORKFLOWS'} py_workflow_parser = PyWorkflowParser(params) py_workflow_parser.parse_workflows() self.assertEquals(3, len(py_workflow_parser.workflows)) self.assertEquals( 2, len(py_workflow_parser.workflows['some_workflow'].jobs)) self.assertEquals( 3, len(py_workflow_parser.workflows['some_other_workflow'].jobs)) self.assertEquals( 3, len(py_workflow_parser.workflows['another_workflow'].jobs)) self.assertEquals( 24 * 60 * 60, py_workflow_parser.workflows['some_workflow']. schedule.recurrence_seconds) self.assertEquals( 60 * 60, py_workflow_parser.workflows['some_other_workflow']. schedule.recurrence_seconds) self.assertEquals( 60 * 60, py_workflow_parser.workflows['another_workflow'].schedule. recurrence_seconds) self.assertEquals(py_workflow_parser.workflows_config_str, 'tests.pinball_ext.workflow.parser_test.WORKFLOWS')
def test_pinball_config_parses(self): from pinball_ext.workflow.parser import PyWorkflowParser params =\ {'workflows_config': 'pinball_ext.examples.workflows.WORKFLOWS'} py_workflow_parser = PyWorkflowParser(params) py_workflow_parser.parse_workflows()