Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds test example for hello_update.py #118

Merged
merged 7 commits into from
Jul 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions tests/hello/hello_update_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import uuid

from temporalio.client import Client, WorkflowExecutionStatus
from temporalio.worker import Worker

from hello.hello_update import GreetingWorkflow


async def test_signal_workflow(client: Client):
yashvanzara marked this conversation as resolved.
Show resolved Hide resolved
task_queue_name = str(uuid.uuid4())
async with Worker(client, task_queue=task_queue_name, workflows=[GreetingWorkflow]):
handle = await client.start_workflow(
GreetingWorkflow.run, id=str(uuid.uuid4()), task_queue=task_queue_name
)

assert WorkflowExecutionStatus.RUNNING == (await handle.describe()).status

update_result = await handle.execute_update(
GreetingWorkflow.update_workflow_status
)
assert "Workflow status updated" == update_result
assert WorkflowExecutionStatus.COMPLETED == (await handle.describe()).status
yashvanzara marked this conversation as resolved.
Show resolved Hide resolved
Loading