Skip to content

Commit 591c531

Browse files
committed
Add test
1 parent 2413a16 commit 591c531

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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!"

0 commit comments

Comments
 (0)