File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
articles/azure-functions/durable Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ Orchestrator functions manage the execution of multiple activity functions. To t
79
79
import unittest
80
80
from unittest.mock import Mock, patch, call
81
81
from datetime import timedelta
82
+ from azure.durable_functions.testing import orchestrator_generator_wrapper
83
+
84
+ from function_app import my_orchestrator
85
+
82
86
83
87
class TestFunction (unittest .TestCase ):
84
88
@patch (' azure.durable_functions.DurableOrchestrationContext' )
@@ -91,7 +95,8 @@ class TestFunction(unittest.TestCase):
91
95
# Create a generator using the method and mocked context
92
96
user_orchestrator = func_call(context)
93
97
94
- # Use a method defined above to get the values from the generator. Quick unwrap for easy access
98
+ # Use orchestrator_generator_wrapper to get the values from the generator.
99
+ # Processes the orchestrator in a way that is equivalent to the Durable replay logic
95
100
values = [val for val in orchestrator_generator_wrapper(user_orchestrator)]
96
101
97
102
expected_activity_calls = [call(' say_hello' , ' Tokyo' ),
You can’t perform that action at this time.
0 commit comments