File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ import uuid
2+ from datetime import timedelta
3+
4+ from temporalio import activity
5+ from temporalio .client import Client
6+ from temporalio .common import ActivityExecutionStatus
7+
8+
9+ @activity .defn
10+ async def increment (input : int ) -> int :
11+ return input + 1
12+
13+
14+ async def test_describe_activity (client : Client ):
15+ activity_id = str ("test_start_and_describe_activity_id" )
16+ task_queue = str (uuid .uuid4 ())
17+
18+ activity_handle = await client .start_activity (
19+ increment ,
20+ args = (1 ,),
21+ id = activity_id ,
22+ task_queue = task_queue ,
23+ start_to_close_timeout = timedelta (seconds = 5 ),
24+ )
25+ desc = await activity_handle .describe ()
26+ assert desc .activity_id == activity_id
27+ assert desc .run_id == activity_handle .run_id
28+ assert desc .activity_type == "increment"
29+ assert desc .task_queue == task_queue
30+ assert desc .status in [
31+ ActivityExecutionStatus .RUNNING ,
32+ ActivityExecutionStatus .COMPLETED ,
33+ ]
You can’t perform that action at this time.
0 commit comments