Skip to content

Commit 976532d

Browse files
committed
Assert describe returns new state after transition
1 parent 4d355d1 commit 976532d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/test_activity.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ async def test_manual_completion(client: Client):
116116
await async_activity_handle.complete(7)
117117
assert await activity_handle.result() == 7
118118

119+
desc = await activity_handle.describe()
120+
assert desc.status == ActivityExecutionStatus.COMPLETED
121+
119122

120123
async def test_manual_cancellation(client: Client):
121124
activity_id = str(uuid.uuid4())
@@ -153,8 +156,11 @@ async def test_manual_cancellation(client: Client):
153156
assert isinstance(err.value.cause, CancelledError)
154157
assert str(err.value.cause) == "Test cancellation"
155158

159+
desc = await activity_handle.describe()
160+
assert desc.status == ActivityExecutionStatus.CANCELED
161+
156162

157-
async def test_manual_fail(client: Client):
163+
async def test_manual_failure(client: Client):
158164
activity_id = str(uuid.uuid4())
159165
task_queue = str(uuid.uuid4())
160166
wait_for_signal_workflow_id = str(uuid.uuid4())
@@ -189,6 +195,9 @@ async def test_manual_fail(client: Client):
189195
assert isinstance(err.value.cause, ApplicationError)
190196
assert str(err.value.cause) == "Test failure"
191197

198+
desc = await activity_handle.describe()
199+
assert desc.status == ActivityExecutionStatus.FAILED
200+
192201

193202
@activity.defn
194203
async def activity_for_testing_heartbeat(input: ActivityInput) -> str:

0 commit comments

Comments
 (0)