# Path: mistralclient/api/v2/executions.py
# class Execution(base.Resource):
#     resource_name = 'Execution'
# 
# Path: mistralclient/api/v2/tasks.py
# class Task(base.Resource):
# class TaskManager(base.ResourceManager):
#     def list(self, workflow_execution_id=None, marker='', limit=None,
#              sort_keys='', sort_dirs='', fields=None, **filters):
#     def get(self, id):
#     def get_task_sub_executions(self, id, errors_only='', max_depth=-1):
#     def rerun(self, task_ex_id, reset=True, env=None):
# 
# Path: mistralclient/tests/unit/v2/base.py
# class BaseClientV2Test(base.BaseClientTest):
#     TEST_URL = 'http://mistral.example.com'
#     def setUp(self):


from oslo_serialization import jsonutils
from mistralclient.api.v2.executions import Execution
from mistralclient.api.v2 import tasks
from mistralclient.tests.unit.v2 import base


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

TASK = {
    'id': "1",
    'workflow_execution_id': '123',
    'name': 'my_task',
    'workflow_name': 'my_wf',
    'state': 'RUNNING',
    'tags': ['deployment', 'demo'],
    'result': {'some': 'result'}
}

SUB_WF_EXEC = {
    'id': "456",
    'workflow_id': '123e4567-e89b-12d3-a456-426655440000',
    'workflow_name': 'my_sub_wf',
    'workflow_namespace': '',
    'task_execution_id': "1",
    'description': '',
    'state': 'RUNNING',
    'input': {}
}

URL_TEMPLATE = '/tasks'
URL_TEMPLATE_ID = '/tasks/%s'
URL_TEMPLATE_SUB_EXECUTIONS = '/tasks/%s/executions%s'



# Path: mistralclient/api/v2/executions.py
# class Execution(base.Resource):
#     resource_name = 'Execution'
# 
# Path: mistralclient/api/v2/tasks.py
# class Task(base.Resource):
# class TaskManager(base.ResourceManager):
#     def list(self, workflow_execution_id=None, marker='', limit=None,
#              sort_keys='', sort_dirs='', fields=None, **filters):
#     def get(self, id):
#     def get_task_sub_executions(self, id, errors_only='', max_depth=-1):
#     def rerun(self, task_ex_id, reset=True, env=None):
# 
# 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_tasks.py
from oslo_serialization import jsonutils
from mistralclient.api.v2.executions import Execution
from mistralclient.api.v2 import tasks
from mistralclient.tests.unit.v2 import base



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

TASK = {
    'id': "1",
    'workflow_execution_id': '123',
    'name': 'my_task',
    'workflow_name': 'my_wf',
    'state': 'RUNNING',
    'tags': ['deployment', 'demo'],
    'result': {'some': 'result'}
}

SUB_WF_EXEC = {
    'id': "456",
    'workflow_id': '123e4567-e89b-12d3-a456-426655440000',
    'workflow_name': 'my_sub_wf',
    'workflow_namespace': '',
    'task_execution_id': "1",
    'description': '',
    'state': 'RUNNING',
    'input': {}
}

URL_TEMPLATE = '/tasks'
URL_TEMPLATE_ID = '/tasks/%s'
URL_TEMPLATE_SUB_EXECUTIONS = '/tasks/%s/executions%s'



class TestTasksV2(base.BaseClientV2Test):