|
| 1 | +import uuid |
| 2 | +from concurrent.futures import ThreadPoolExecutor |
| 3 | + |
| 4 | +import pytest |
| 5 | +from temporalio.client import Client |
| 6 | +from temporalio.worker import Worker |
| 7 | + |
| 8 | +from openai_agents.basic.workflows.remote_image_workflow import RemoteImageWorkflow |
| 9 | + |
| 10 | +# TODO(@donald-pinckney): debug this test |
| 11 | +# async def test_execute_workflow_default_question(client: Client): |
| 12 | +# task_queue_name = str(uuid.uuid4()) |
| 13 | + |
| 14 | +# async with Worker( |
| 15 | +# client, |
| 16 | +# task_queue=task_queue_name, |
| 17 | +# workflows=[RemoteImageWorkflow], |
| 18 | +# activity_executor=ThreadPoolExecutor(5), |
| 19 | +# # No external activities needed - uses remote URL directly |
| 20 | +# ): |
| 21 | +# # Using a reliable test image URL |
| 22 | +# test_image_url = "https://httpbin.org/image/jpeg" |
| 23 | + |
| 24 | +# result = await client.execute_workflow( |
| 25 | +# RemoteImageWorkflow.run, |
| 26 | +# test_image_url, |
| 27 | +# id=str(uuid.uuid4()), |
| 28 | +# task_queue=task_queue_name, |
| 29 | +# ) |
| 30 | + |
| 31 | +# # Verify the result is a string response |
| 32 | +# assert isinstance(result, str) |
| 33 | +# assert len(result) > 0 |
| 34 | + |
| 35 | + |
| 36 | +# TODO(@donald-pinckney): debug this test |
| 37 | +# async def test_execute_workflow_custom_question(client: Client): |
| 38 | +# task_queue_name = str(uuid.uuid4()) |
| 39 | + |
| 40 | +# async with Worker( |
| 41 | +# client, |
| 42 | +# task_queue=task_queue_name, |
| 43 | +# workflows=[RemoteImageWorkflow], |
| 44 | +# activity_executor=ThreadPoolExecutor(5), |
| 45 | +# # No external activities needed - uses remote URL directly |
| 46 | +# ): |
| 47 | +# # Using a reliable test image URL |
| 48 | +# test_image_url = "https://httpbin.org/image/png" |
| 49 | +# custom_question = "What do you see in this image?" |
| 50 | + |
| 51 | +# result = await client.execute_workflow( |
| 52 | +# RemoteImageWorkflow.run, |
| 53 | +# args=[test_image_url, custom_question], |
| 54 | +# id=str(uuid.uuid4()), |
| 55 | +# task_queue=task_queue_name, |
| 56 | +# ) |
| 57 | + |
| 58 | +# # Verify the result is a string response |
| 59 | +# assert isinstance(result, str) |
| 60 | +# assert len(result) > 0 |
0 commit comments