File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1897,6 +1897,25 @@ async def test_streamablehttp_client_with_reconnection_options(basic_server: Non
18971897 assert isinstance (result , InitializeResult )
18981898
18991899
1900+ def test_reconnection_options_validation ():
1901+ """Test StreamableHTTPReconnectionOptions validates delay settings."""
1902+ from mcp .client .streamable_http import StreamableHTTPReconnectionOptions
1903+
1904+ # Valid options should work
1905+ valid = StreamableHTTPReconnectionOptions (
1906+ initial_reconnection_delay = 1.0 ,
1907+ max_reconnection_delay = 30.0 ,
1908+ )
1909+ assert valid .initial_reconnection_delay == 1.0
1910+
1911+ # Invalid options should raise
1912+ with pytest .raises (ValueError , match = "initial_reconnection_delay cannot exceed" ):
1913+ StreamableHTTPReconnectionOptions (
1914+ initial_reconnection_delay = 60.0 ,
1915+ max_reconnection_delay = 30.0 ,
1916+ )
1917+
1918+
19001919@pytest .mark .anyio
19011920async def test_streamablehttp_client_auto_reconnection (event_server : tuple [SimpleEventStore , str ]):
19021921 """Test automatic client reconnection when server closes SSE stream mid-operation."""
You can’t perform that action at this time.
0 commit comments