File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import uuid
2+ from concurrent .futures import ThreadPoolExecutor
3+ from datetime import timedelta
4+
5+ import pytest
6+ from temporalio .client import Client
7+ from temporalio .worker import Worker
8+
9+ from hello .hello_standalone_activity import ComposeGreetingInput , compose_greeting
10+
11+
12+ async def test_execute_standalone_activity (client : Client ):
13+ pytest .skip ("Standalone Activity is not yet supported by the CLI dev server" )
14+ task_queue_name = str (uuid .uuid4 ())
15+
16+ async with Worker (
17+ client ,
18+ task_queue = task_queue_name ,
19+ activities = [compose_greeting ],
20+ activity_executor = ThreadPoolExecutor (5 ),
21+ ):
22+ result = await client .execute_activity (
23+ compose_greeting ,
24+ args = [ComposeGreetingInput ("Hello" , "World" )],
25+ id = str (uuid .uuid4 ()),
26+ task_queue = task_queue_name ,
27+ start_to_close_timeout = timedelta (seconds = 10 ),
28+ )
29+ assert result == "Hello, World!"
You can’t perform that action at this time.
0 commit comments