⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

test(langchain): add real HTTP server support for agent invoke tests#51

Open
OhYee wants to merge 1 commit intomainfrom
fix-httpx-mock-sse
Open

test(langchain): add real HTTP server support for agent invoke tests#51
OhYee wants to merge 1 commit intomainfrom
fix-httpx-mock-sse

Conversation

@OhYee
Copy link
Member

@OhYee OhYee commented Feb 9, 2026

Add _start_server function to launch actual FastAPI servers for integration testing, modify request functions to accept both app objects and server URLs, and update test fixtures to use real HTTP connections instead of ASGI transport.

This enables more realistic testing of agent invoke methods using actual HTTP requests while maintaining backward compatibility with ASGI transport for non-streaming tests.

The changes affect test_agent_invoke_methods.py with new server startup logic, enhanced request handling, and proper server cleanup in test fixtures.

test(langchain): 为代理调用测试添加真实 HTTP 服务器支持

添加 _start_server 函数以启动实际的 FastAPI 服务器进行集成测试,
修改请求函数以接受 app 对象和服务器 URL,
并更新测试 fixture 以使用真实的 HTTP 连接而不是 ASGI 传输。

这使得使用实际 HTTP 请求对代理调用方法进行更真实的测试
同时保持与 ASGI 传输的向后兼容性以用于非流式测试。

这些更改影响 test_agent_invoke_methods.py 中的新服务器启动逻辑、
增强的请求处理和测试 fixture 中的适当服务器清理。

Change-Id: Icb5b09c2d588021cf72749658b1d07237fc1ef9c

Thank you for creating a pull request to contribute to Serverless Devs agentrun-sdk-python code! Before you open the request please answer the following questions to help it be more easily integrated. Please check the boxes "[ ]" with "[x]" when done too.
Please select one of the PR types below to complete


Fix bugs

Bug detail

The specific manifestation of the bug or the associated issue.

Pull request tasks

  • Add test cases for the changes
  • Passed the CI test

Update docs

Reason for update

Why do you need to update your documentation?

Pull request tasks

  • Update Chinese documentation
  • Update English documentation

Add contributor

Contributed content

  • Code
  • Document

Content detail

if content_type == 'code' || content_type == 'document':
    please tell us `PR url`,like: https://github.com/Serverless-Devs/agentrun-sdk-python/pull/1
else:
    please describe your contribution in detail

Others

Reason for update

Why do you need to update your documentation?

Add _start_server function to launch actual FastAPI servers for integration testing,
modify request functions to accept both app objects and server URLs,
and update test fixtures to use real HTTP connections instead of ASGI transport.

This enables more realistic testing of agent invoke methods using actual HTTP requests
while maintaining backward compatibility with ASGI transport for non-streaming tests.

The changes affect test_agent_invoke_methods.py with new server startup logic,
enhanced request handling, and proper server cleanup in test fixtures.

test(langchain): 为代理调用测试添加真实 HTTP 服务器支持

添加 _start_server 函数以启动实际的 FastAPI 服务器进行集成测试,
修改请求函数以接受 app 对象和服务器 URL,
并更新测试 fixture 以使用真实的 HTTP 连接而不是 ASGI 传输。

这使得使用实际 HTTP 请求对代理调用方法进行更真实的测试
同时保持与 ASGI 传输的向后兼容性以用于非流式测试。

这些更改影响 test_agent_invoke_methods.py 中的新服务器启动逻辑、
增强的请求处理和测试 fixture 中的适当服务器清理。

Change-Id: Icb5b09c2d588021cf72749658b1d07237fc1ef9c
Signed-off-by: OhYee <oyohyee@oyohyee.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant