|
21 | 21 | import requests |
22 | 22 | import uvicorn |
23 | 23 | from httpx_sse import ServerSentEvent |
24 | | -from pydantic import AnyUrl |
25 | 24 | from starlette.applications import Starlette |
26 | 25 | from starlette.requests import Request |
27 | 26 | from starlette.routing import Mount |
@@ -1013,7 +1012,7 @@ async def test_streamable_http_client_resource_read(initialized_client_session: |
1013 | 1012 | """Test client resource read functionality.""" |
1014 | 1013 | response = await initialized_client_session.read_resource(uri="foobar://test-resource") |
1015 | 1014 | assert len(response.contents) == 1 |
1016 | | - assert response.contents[0].uri == AnyUrl("foobar://test-resource") |
| 1015 | + assert response.contents[0].uri == "foobar://test-resource" |
1017 | 1016 | assert isinstance(response.contents[0], TextResourceContents) |
1018 | 1017 | assert response.contents[0].text == "Read test-resource" |
1019 | 1018 |
|
@@ -1132,7 +1131,7 @@ async def message_handler( # pragma: no branch |
1132 | 1131 | resource_update_found = False |
1133 | 1132 | for notif in notifications_received: |
1134 | 1133 | if isinstance(notif.root, types.ResourceUpdatedNotification): # pragma: no branch |
1135 | | - assert str(notif.root.params.uri) == "http://test_resource/" |
| 1134 | + assert str(notif.root.params.uri) == "http://test_resource" |
1136 | 1135 | resource_update_found = True |
1137 | 1136 |
|
1138 | 1137 | assert resource_update_found, "ResourceUpdatedNotification not received via GET stream" |
@@ -2237,10 +2236,10 @@ async def message_handler( |
2237 | 2236 | assert result.content[0].text == "Standalone stream close test done" |
2238 | 2237 |
|
2239 | 2238 | # Verify both notifications were received |
2240 | | - assert "http://notification_1/" in received_notifications, ( |
| 2239 | + assert "http://notification_1" in received_notifications, ( |
2241 | 2240 | f"Should receive notification 1 (sent before GET stream close), got: {received_notifications}" |
2242 | 2241 | ) |
2243 | | - assert "http://notification_2/" in received_notifications, ( |
| 2242 | + assert "http://notification_2" in received_notifications, ( |
2244 | 2243 | f"Should receive notification 2 after reconnect, got: {received_notifications}" |
2245 | 2244 | ) |
2246 | 2245 |
|
|
0 commit comments