Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior af494fe9a -> 4be164d72 (forced update)
another test fix Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/4be164d7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/4be164d7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/4be164d7 Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior Commit: 4be164d720412c6af56dcd722f722afa989da447 Parents: 695a709 Author: max-orlov <[email protected]> Authored: Thu Jun 1 18:29:06 2017 +0300 Committer: max-orlov <[email protected]> Committed: Sun Jun 4 11:01:51 2017 +0300 ---------------------------------------------------------------------- tests/orchestrator/execution_plugin/test_ssh.py | 5 +++-- tests/orchestrator/workflows/core/test_task.py | 2 +- .../workflows/executor/test_process_executor_extension.py | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4be164d7/tests/orchestrator/execution_plugin/test_ssh.py ---------------------------------------------------------------------- diff --git a/tests/orchestrator/execution_plugin/test_ssh.py b/tests/orchestrator/execution_plugin/test_ssh.py index 8056649..2f0b39c 100644 --- a/tests/orchestrator/execution_plugin/test_ssh.py +++ b/tests/orchestrator/execution_plugin/test_ssh.py @@ -427,11 +427,13 @@ class TestFabricEnvHideGroupsAndRunCommands(object): def abort(message=None): models.Task.abort(message) actor = None + class Actor(object): host = None + class Model(object): @contextlib.contextmanager - def instrument(*args, **kwargs): + def instrument(self, *args, **kwargs): yield task = Task task.actor = Actor @@ -444,7 +446,6 @@ class TestFabricEnvHideGroupsAndRunCommands(object): yield _Ctx.logging_handlers = _mock_self_logging - @pytest.fixture(autouse=True) def _setup(self, mocker): self.default_fabric_env = { http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4be164d7/tests/orchestrator/workflows/core/test_task.py ---------------------------------------------------------------------- diff --git a/tests/orchestrator/workflows/core/test_task.py b/tests/orchestrator/workflows/core/test_task.py index a717e19..c0d3616 100644 --- a/tests/orchestrator/workflows/core/test_task.py +++ b/tests/orchestrator/workflows/core/test_task.py @@ -100,7 +100,7 @@ class TestOperationTask(object): storage_task = ctx.model.task.get_by_name(core_task.name) assert storage_task.plugin is storage_plugin assert storage_task.execution_name == ctx.execution.name - assert storage_task.actor == core_task.context.node._original_model + assert storage_task.actor == core_task.context.node assert core_task.model_task == storage_task assert core_task.name == api_task.name assert core_task.function == api_task.function http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4be164d7/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 e4944df..f3e40b6 100644 --- a/tests/orchestrator/workflows/executor/test_process_executor_extension.py +++ b/tests/orchestrator/workflows/executor/test_process_executor_extension.py @@ -66,8 +66,9 @@ class MockProcessExecutorExtension(object): def decorate(self): def decorator(function): def wrapper(ctx, **operation_arguments): - ctx.node.attributes['out'] = {'wrapper_arguments': operation_arguments} - function(ctx=ctx, **operation_arguments) + with ctx.model.instrument({ctx.model.node.model_cls: ['attributes']}): + ctx.node.attributes['out'] = {'wrapper_arguments': operation_arguments} + function(ctx=ctx, **operation_arguments) return wrapper return decorator
