You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by ra...@apache.org on 2017/04/06 08:29:38 UTC

[12/32] incubator-ariatosca git commit: fixed tests

fixed tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/fb6a8d96
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/fb6a8d96
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/fb6a8d96

Branch: refs/heads/ARIA-48-aria-cli
Commit: fb6a8d96c5a0c93d9c44c0609408ed26e9e339a7
Parents: 8771e33
Author: Ran Ziv <ra...@gigaspaces.com>
Authored: Sun Apr 2 17:34:31 2017 +0300
Committer: Ran Ziv <ra...@gigaspaces.com>
Committed: Thu Apr 6 11:29:17 2017 +0300

----------------------------------------------------------------------
 aria/utils/type.py                                   |  1 +
 tests/orchestrator/workflows/api/test_task.py        | 15 +++++++++------
 ...test_process_executor_concurrent_modifications.py |  3 ++-
 .../executor/test_process_executor_extension.py      |  3 ++-
 .../test_process_executor_tracked_changes.py         |  6 ++++--
 5 files changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fb6a8d96/aria/utils/type.py
----------------------------------------------------------------------
diff --git a/aria/utils/type.py b/aria/utils/type.py
index e427be1..494a2c2 100644
--- a/aria/utils/type.py
+++ b/aria/utils/type.py
@@ -21,6 +21,7 @@ def validate_value_type(value, type_name):
     name_to_type = {
         'list': list,
         'dict': dict,
+        'tuple': tuple,
         'str': str,
         'unicode': str,
         'string': str,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fb6a8d96/tests/orchestrator/workflows/api/test_task.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/api/test_task.py b/tests/orchestrator/workflows/api/test_task.py
index 80d2351..33b9b94 100644
--- a/tests/orchestrator/workflows/api/test_task.py
+++ b/tests/orchestrator/workflows/api/test_task.py
@@ -46,18 +46,19 @@ class TestOperationTask(object):
         ctx.model.node.update(plugin)
 
         plugin_specification = mock.models.create_plugin_specification('test_plugin', '0.1')
+        inputs = {'test_input': True}
 
         interface = mock.models.create_interface(
             ctx.service,
             interface_name,
             operation_name,
             operation_kwargs=dict(plugin_specification=plugin_specification,
-                                  implementation='op_path'))
+                                  implementation='op_path',
+                                  inputs=inputs),)
 
         node = ctx.model.node.get_by_name(mock.models.DEPENDENT_NODE_NAME)
         node.interfaces[interface_name] = interface
         ctx.model.node.update(node)
-        inputs = {'test_input': True}
         max_attempts = 10
         retry_interval = 10
         ignore_failure = True
@@ -95,18 +96,19 @@ class TestOperationTask(object):
         ctx.model.plugin.update(plugin)
 
         plugin_specification = mock.models.create_plugin_specification('test_plugin', '0.1')
+        inputs = {'test_input': True}
 
         interface = mock.models.create_interface(
             ctx.service,
             interface_name,
             operation_name,
             operation_kwargs=dict(plugin_specification=plugin_specification,
-                                  implementation='op_path')
+                                  implementation='op_path',
+                                  inputs=inputs)
         )
 
         relationship = ctx.model.relationship.list()[0]
         relationship.interfaces[interface.name] = interface
-        inputs = {'test_input': True}
         max_attempts = 10
         retry_interval = 10
 
@@ -141,18 +143,19 @@ class TestOperationTask(object):
         ctx.model.node.update(plugin)
 
         plugin_specification = mock.models.create_plugin_specification('test_plugin', '0.1')
+        inputs = {'test_input': True}
 
         interface = mock.models.create_interface(
             ctx.service,
             interface_name,
             operation_name,
             operation_kwargs=dict(plugin_specification=plugin_specification,
-                                  implementation='op_path')
+                                  implementation='op_path',
+                                  inputs=inputs)
         )
 
         relationship = ctx.model.relationship.list()[0]
         relationship.interfaces[interface.name] = interface
-        inputs = {'test_input': True}
         max_attempts = 10
         retry_interval = 10
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fb6a8d96/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py b/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
index 6d0eb5b..88e7ae0 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
@@ -90,7 +90,8 @@ def _test(context, executor, lock_files, func, expected_failure):
         node.service,
         interface_name,
         operation_name,
-        operation_kwargs=dict(implementation='{0}.{1}'.format(__name__, func.__name__))
+        operation_kwargs=dict(implementation='{0}.{1}'.format(__name__, func.__name__),
+                              inputs=inputs)
     )
     node.interfaces[interface.name] = interface
     context.model.node.update(node)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fb6a8d96/tests/orchestrator/workflows/executor/test_process_executor_extension.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_process_executor_extension.py b/tests/orchestrator/workflows/executor/test_process_executor_extension.py
index 0988fae..7ae337d 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor_extension.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor_extension.py
@@ -42,7 +42,8 @@ def test_decorate_extension(context, executor):
             interface_name,
             operation_name,
             operation_kwargs=dict(implementation='{0}.{1}'.format(__name__,
-                                                                  _mock_operation.__name__))
+                                                                  _mock_operation.__name__),
+                                  inputs=inputs)
         )
         node.interfaces[interface.name] = interface
         task = api.task.OperationTask.for_node(node=node,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fb6a8d96/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py b/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
index 5512189..feebb6a 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
@@ -90,17 +90,19 @@ def _run_workflow(context, executor, op_func, inputs=None):
         node = ctx.model.node.get_by_name(mock.models.DEPENDENCY_NODE_NAME)
         interface_name = 'test_interface'
         operation_name = 'operation'
+        inputs = inputs or {}
         interface = mock.models.create_interface(
             ctx.service,
             interface_name,
             operation_name,
-            operation_kwargs=dict(implementation=_operation_mapping(op_func))
+            operation_kwargs=dict(implementation=_operation_mapping(op_func),
+                                  inputs=inputs)
         )
         node.interfaces[interface.name] = interface
         task = api.task.OperationTask.for_node(node=node,
                                                interface_name=interface_name,
                                                operation_name=operation_name,
-                                               inputs=inputs or {})
+                                               inputs=inputs)
         graph.add_tasks(task)
         return graph
     graph = mock_workflow(ctx=context)  # pylint: disable=no-value-for-parameter