예제 #1
0
    def test_wait_for_execution(self):
        self.workflow.find_execution.return_value = 'exn'
        d = mistral_v2.MistralClient(self.conn_params)

        d.wait_for_execution('exn', 'STATUS1', ['STATUS2'], 5, 10)

        self.workflow.wait_for_status.assert_called_once_with(
            'exn', 'STATUS1', ['STATUS2'], 5, 10)
예제 #2
0
    def test_workflow_create(self):
        d = mistral_v2.MistralClient(self.conn_params)
        attrs = {
            'definition': 'fake_definition',
            'scope': 'private',
        }

        d.workflow_create('fake_definition', 'private')

        self.workflow.create_workflow.assert_called_once_with(**attrs)
예제 #3
0
    def test_workflow_delete(self):
        d = mistral_v2.MistralClient(self.conn_params)

        d.workflow_delete('foo', True)

        self.workflow.delete_workflow.assert_called_once_with(
            'foo', ignore_missing=True)
        self.workflow.delete_workflow.reset_mock()

        d.workflow_delete('foo', False)

        self.workflow.delete_workflow.assert_called_once_with(
            'foo', ignore_missing=False)
예제 #4
0
 def test_execution_create(self):
     d = mistral_v2.MistralClient(self.conn_params)
     attrs = {'workflow_name': 'workflow_name', 'input': 'input'}
     d.execution_create('workflow_name', 'input')
     self.workflow.create_execution.assert_called_once_with(**attrs)
예제 #5
0
    def test_init(self):
        d = mistral_v2.MistralClient(self.conn_params)

        self.mock_create.assert_called_once_with(self.conn_params)
        self.assertEqual(self.mock_conn, d.conn)