diff --git a/murano/engine/mock_context_manager.py b/murano/engine/mock_context_manager.py index 9db18424..08e7d344 100644 --- a/murano/engine/mock_context_manager.py +++ b/murano/engine/mock_context_manager.py @@ -145,6 +145,8 @@ def inject_method_with_yaql_expr(context, target, target_method, expr): def payload_adapter(__super, __context, __sender, *args, **kwargs): new_context = context.create_child_context() new_context[constants.CTX_ORIGINAL_CONTEXT] = __context + new_context.register_function(lambda: __super(*args, **kwargs), + name='originalMethod') return expr(new_context, __sender, *args, **kwargs) result_fd.payload = payload_adapter diff --git a/murano/tests/unit/engine/test_mock_context_manager.py b/murano/tests/unit/engine/test_mock_context_manager.py index a8b530b8..61952e27 100644 --- a/murano/tests/unit/engine/test_mock_context_manager.py +++ b/murano/tests/unit/engine/test_mock_context_manager.py @@ -127,3 +127,7 @@ class TestMockYaqlFunctions(test_case.DslTestCase): def test_with_original(self): self.runner.testWithoriginal() self.assertEqual(['DEFAULT'], self.traces) + + def test_original_method(self): + self.runner.testOriginalMethod() + self.assertEqual(['method1'], self.traces)