# Path: mistralclient/api/v2/action_executions.py
# class ActionExecution(base.Resource):
# class ActionExecutionManager(base.ResourceManager):
#     def create(self, name, input=None, namespace='', **params):
#     def update(self, id, state=None, output=None):
#     def list(self, task_execution_id=None, limit=None, marker='', fields=None,
#              sort_keys='', sort_dirs='', **filters):
#     def get(self, id):
#     def delete(self, id):
# 
# Path: mistralclient/tests/unit/v2/base.py
# class BaseClientV2Test(base.BaseClientTest):
#     TEST_URL = 'http://mistral.example.com'
#     def setUp(self):


from mistralclient.api.v2 import action_executions
from mistralclient.tests.unit.v2 import base
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.


# TODO(everyone): later we need additional tests verifying all the errors etc.

ACTION_EXEC = {
    'id': "1",
    'name': 'my_action_execution',
    'workflow_name': 'my_wf',
    'state': 'RUNNING',
}

URL_TEMPLATE = '/action_executions'
URL_TEMPLATE_ID = '/action_executions/%s'


class TestActionExecutions(base.BaseClientV2Test):
    def test_create(self):
        self.requests_mock.post(self.TEST_URL + URL_TEMPLATE,
                                json=ACTION_EXEC,
                                status_code=201)

        body = {
            'name': ACTION_EXEC['name']
        }


# Path: mistralclient/api/v2/action_executions.py
# class ActionExecution(base.Resource):
# class ActionExecutionManager(base.ResourceManager):
#     def create(self, name, input=None, namespace='', **params):
#     def update(self, id, state=None, output=None):
#     def list(self, task_execution_id=None, limit=None, marker='', fields=None,
#              sort_keys='', sort_dirs='', **filters):
#     def get(self, id):
#     def delete(self, id):
# 
# Path: mistralclient/tests/unit/v2/base.py
# class BaseClientV2Test(base.BaseClientTest):
#     TEST_URL = 'http://mistral.example.com'
#     def setUp(self):


# Path: mistralclient/tests/unit/v2/test_action_executions.py
from mistralclient.api.v2 import action_executions
from mistralclient.tests.unit.v2 import base

#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.


# TODO(everyone): later we need additional tests verifying all the errors etc.

ACTION_EXEC = {
    'id': "1",
    'name': 'my_action_execution',
    'workflow_name': 'my_wf',
    'state': 'RUNNING',
}

URL_TEMPLATE = '/action_executions'
URL_TEMPLATE_ID = '/action_executions/%s'


class TestActionExecutions(base.BaseClientV2Test):
    def test_create(self):
        self.requests_mock.post(self.TEST_URL + URL_TEMPLATE,
                                json=ACTION_EXEC,
                                status_code=201)

        body = {
            'name': ACTION_EXEC['name']
        }


        action_execution = self.action_executions.create(