# Path: mistraldashboard/api.py
# SERVICE_TYPE = 'workflowv2'
# def mistralclient(request):
# def pagination_list(entity, request, marker='', sort_keys='', sort_dirs='asc',
#                     paginate=False, reversed_order=False, selector=None):
# def execution_create(request, **data):
# def execution_get(request, execution_id):
# def execution_update(request, execution_id, field, value):
# def execution_delete(request, execution_name):
# def task_list(request, execution_id=None):
# def task_get(request, task_id=None):
# def workflow_list(request):
# def workflow_get(request, workflow_name):
# def workflow_create(request, workflows_definition):
# def workflow_validate(request, workflow_definition):
# def workflow_delete(request, workflow_name):
# def workflow_update(request, workflows_definition):
# def workbook_list(request):
# def workbook_get(request, workbook_name):
# def workbook_create(request, workbook_definition):
# def workbook_validate(request, workbook_definition):
# def workbook_delete(request, workbook_name):
# def workbook_update(request, workbook_definition):
# def action_list(request):
# def action_get(request, action_name):
# def action_create(request, action_definition):
# def action_update(request, action_definition):
# def action_run(request, action_name, input, params):
# def action_delete(request, action_name):
# def action_executions_list(request, task_execution_id=None):
# def action_execution_get(request, action_execution_id):
# def action_execution_delete(request, action_execution_id):
# def action_execution_update(request, id, state=None, output=None):
# def cron_trigger_list(request):
# def cron_trigger_get(request, cron_trigger_name):
# def cron_trigger_delete(request, cron_trigger_name):
# def cron_trigger_create(
#     request,
#     cron_trigger_name,
#     workflow_ID,
#     workflow_input,
#     workflow_params,
#     pattern,
#     first_time,
#     count
# ):
# 
# Path: mistraldashboard/test/helpers.py
# class MistralTestsMixin(object):
# class TestCase(MistralTestsMixin, helpers.TestCase):
# class APITestCase(MistralTestsMixin, helpers.APITestCase):
#     def _setup_test_data(self):


from django.urls import reverse
from openstack_dashboard.test import helpers as horizon_test
from mistraldashboard import api
from mistraldashboard.test import helpers as test
        action = self.mistralclient_actions.first()
        self.mock_action_create.return_value = action
        url = reverse("horizon:mistral:actions:create")
        form_data = {
            'definition_source': 'raw',
            'definition_data': action.definition
        }
        res = self.client.post(url, form_data)

        self.assertNoFormErrors(res)
        self.mock_action_create.assert_called_once_with(
            horizon_test.IsHttpRequest(),
            action.definition)

    @horizon_test.create_mocks({api: ('action_update',)})
    def test_update_post(self):
        action = self.mistralclient_actions.first()
        self.mock_action_update.return_value = action
        url = reverse("horizon:mistral:actions:update")
        form_data = {
            'definition_source': 'raw',
            'definition_data': action.definition
        }
        res = self.client.post(url, form_data)

        self.assertNoFormErrors(res)
        self.mock_action_update.assert_called_once_with(
            horizon_test.IsHttpRequest(),
            action.definition)


# Path: mistraldashboard/api.py
# SERVICE_TYPE = 'workflowv2'
# def mistralclient(request):
# def pagination_list(entity, request, marker='', sort_keys='', sort_dirs='asc',
#                     paginate=False, reversed_order=False, selector=None):
# def execution_create(request, **data):
# def execution_get(request, execution_id):
# def execution_update(request, execution_id, field, value):
# def execution_delete(request, execution_name):
# def task_list(request, execution_id=None):
# def task_get(request, task_id=None):
# def workflow_list(request):
# def workflow_get(request, workflow_name):
# def workflow_create(request, workflows_definition):
# def workflow_validate(request, workflow_definition):
# def workflow_delete(request, workflow_name):
# def workflow_update(request, workflows_definition):
# def workbook_list(request):
# def workbook_get(request, workbook_name):
# def workbook_create(request, workbook_definition):
# def workbook_validate(request, workbook_definition):
# def workbook_delete(request, workbook_name):
# def workbook_update(request, workbook_definition):
# def action_list(request):
# def action_get(request, action_name):
# def action_create(request, action_definition):
# def action_update(request, action_definition):
# def action_run(request, action_name, input, params):
# def action_delete(request, action_name):
# def action_executions_list(request, task_execution_id=None):
# def action_execution_get(request, action_execution_id):
# def action_execution_delete(request, action_execution_id):
# def action_execution_update(request, id, state=None, output=None):
# def cron_trigger_list(request):
# def cron_trigger_get(request, cron_trigger_name):
# def cron_trigger_delete(request, cron_trigger_name):
# def cron_trigger_create(
#     request,
#     cron_trigger_name,
#     workflow_ID,
#     workflow_input,
#     workflow_params,
#     pattern,
#     first_time,
#     count
# ):
# 
# Path: mistraldashboard/test/helpers.py
# class MistralTestsMixin(object):
# class TestCase(MistralTestsMixin, helpers.TestCase):
# class APITestCase(MistralTestsMixin, helpers.APITestCase):
#     def _setup_test_data(self):


# Path: mistraldashboard/actions/tests.py
from django.urls import reverse
from openstack_dashboard.test import helpers as horizon_test
from mistraldashboard import api
from mistraldashboard.test import helpers as test

        action = self.mistralclient_actions.first()
        self.mock_action_create.return_value = action
        url = reverse("horizon:mistral:actions:create")
        form_data = {
            'definition_source': 'raw',
            'definition_data': action.definition
        }
        res = self.client.post(url, form_data)

        self.assertNoFormErrors(res)
        self.mock_action_create.assert_called_once_with(
            horizon_test.IsHttpRequest(),
            action.definition)

    @horizon_test.create_mocks({api: ('action_update',)})
    def test_update_post(self):
        action = self.mistralclient_actions.first()
        self.mock_action_update.return_value = action
        url = reverse("horizon:mistral:actions:update")
        form_data = {
            'definition_source': 'raw',
            'definition_data': action.definition
        }
        res = self.client.post(url, form_data)

        self.assertNoFormErrors(res)
        self.mock_action_update.assert_called_once_with(
            horizon_test.IsHttpRequest(),
            action.definition)


    @horizon_test.create_mocks({api: ('action_get',)})