Skip to content

Commit 9228299

Browse files
committed
test(jsonrpc): add tests for stream_send_timeout parameter in A2AFastAPIApplication and A2AStarletteApplication
1 parent 07c1f94 commit 9228299

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

tests/server/apps/jsonrpc/test_fastapi_app.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,23 @@ def test_create_a2a_fastapi_app_with_missing_deps_raises_importerror(
7575
):
7676
_app = A2AFastAPIApplication(**mock_app_params)
7777

78+
def test_stream_send_timeout_parameter(self, mock_app_params: dict):
79+
try:
80+
app_default = A2AFastAPIApplication(**mock_app_params)
81+
assert app_default.stream_send_timeout is None
82+
83+
app_custom = A2AFastAPIApplication(
84+
**mock_app_params, stream_send_timeout=30.0
85+
)
86+
assert app_custom.stream_send_timeout == 30.0
87+
88+
app_none = A2AFastAPIApplication(
89+
**mock_app_params, stream_send_timeout=None
90+
)
91+
assert app_none.stream_send_timeout is None
92+
except ImportError:
93+
pytest.skip('FastAPI dependencies not available')
94+
7895

7996
if __name__ == '__main__':
8097
pytest.main([__file__])

tests/server/apps/jsonrpc/test_starlette_app.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,23 @@ def test_create_a2a_starlette_app_with_missing_deps_raises_importerror(
7777
):
7878
_app = A2AStarletteApplication(**mock_app_params)
7979

80+
def test_stream_send_timeout_parameter(self, mock_app_params: dict):
81+
try:
82+
app_default = A2AStarletteApplication(**mock_app_params)
83+
assert app_default.stream_send_timeout is None
84+
85+
app_custom = A2AStarletteApplication(
86+
**mock_app_params, stream_send_timeout=30.0
87+
)
88+
assert app_custom.stream_send_timeout == 30.0
89+
90+
app_none = A2AStarletteApplication(
91+
**mock_app_params, stream_send_timeout=None
92+
)
93+
assert app_none.stream_send_timeout is None
94+
except ImportError:
95+
pytest.skip('Starlette dependencies not available')
96+
8097

8198
if __name__ == '__main__':
8299
pytest.main([__file__])

0 commit comments

Comments
 (0)