Skip to content

Commit 96476b9

Browse files
committed
Update orchestrator code sample
1 parent 7760942 commit 96476b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

articles/azure-functions/durable/durable-functions-unit-testing-python.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ Orchestrator functions manage the execution of multiple activity functions. To t
7979
import unittest
8080
from unittest.mock import Mock, patch, call
8181
from datetime import timedelta
82+
from azure.durable_functions.testing import orchestrator_generator_wrapper
83+
84+
from function_app import my_orchestrator
85+
8286

8387
class TestFunction(unittest.TestCase):
8488
@patch('azure.durable_functions.DurableOrchestrationContext')
@@ -91,7 +95,8 @@ class TestFunction(unittest.TestCase):
9195
# Create a generator using the method and mocked context
9296
user_orchestrator = func_call(context)
9397

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
95100
values = [val for val in orchestrator_generator_wrapper(user_orchestrator)]
96101

97102
expected_activity_calls = [call('say_hello', 'Tokyo'),

0 commit comments

Comments
 (0)