Exemple #1
0
    def test_create_execution(self, mock__create_workbook,
                              mock__create_execution):

        executions.CreateExecutionFromWorkbook(self.context).run(WB_DEFINITION)

        self.assertEqual(1, mock__create_workbook.called)
        self.assertEqual(1, mock__create_execution.called)
Exemple #2
0
    def test_create_execution_with_input(self, mock__create_workbook,
                                         mock__create_execution):

        executions.CreateExecutionFromWorkbook(self.context).run(
            WB_DEFINITION, wf_input=INPUT_EXAMPLE)

        self.assertEqual(1, mock__create_workbook.called)
        self.assertEqual(1, mock__create_execution.called)
Exemple #3
0
    def test_create_execution_with_params(self, mock_loads,
                                          mock__create_workbook,
                                          mock__create_execution):

        executions.CreateExecutionFromWorkbook(self.context).run(
            WB_DEFINITION, params=str(PARAMS_EXAMPLE))

        self.assertEqual(1, mock_loads.called)
        self.assertEqual(1, mock__create_workbook.called)
        self.assertEqual(1, mock__create_execution.called)
Exemple #4
0
    def test_create_execution_with_wf_name(self, mock__create_workbook,
                                           mock__create_execution):

        executions.CreateExecutionFromWorkbook(self.context).run(
            WB_DEFINITION, "wf4")

        self.assertEqual(1, mock__create_workbook.called)
        self.assertEqual(1, mock__create_execution.called)

        # we concatenate workbook name with the workflow name in the test
        # the workbook name is not random because we mock the method that
        # adds the random part
        mock__create_execution.assert_called_once_with("wb.wf4")
Exemple #5
0
    def test_create_delete_execution_without_wf_name(self,
                                                     mock__create_workbook,
                                                     mock__create_execution,
                                                     mock__delete_workbook,
                                                     mock__delete_execution):

        executions.CreateExecutionFromWorkbook(self.context).run(
            WB_DEF_ONE_WF, do_delete=True)

        self.assertEqual(1, mock__create_workbook.called)
        self.assertEqual(1, mock__create_execution.called)
        self.assertEqual(1, mock__delete_workbook.called)
        self.assertEqual(1, mock__delete_execution.called)

        # we concatenate workbook name with the workflow name in the test
        # the workbook name is not random because we mock the method that
        # adds the random part
        mock__create_execution.assert_called_once_with("wb.wf1", None)