test: interaction-model end-to-end suite with a requirements manifest (#2691)
This commit is contained in:
parent
3eb579948a
commit
24725633f1
1 changed files with 14355 additions and 121 deletions
|
|
@ -210,7 +210,7 @@ class StreamableHTTPTransport:
|
|||
# Stream ended normally (server closed) - reset attempt counter
|
||||
attempt = 0
|
||||
|
||||
except Exception: # pragma: lax no cover
|
||||
except Exception:
|
||||
logger.debug("GET stream error", exc_info=True)
|
||||
attempt += 1
|
||||
|
||||
|
|
@ -267,8 +267,8 @@ class StreamableHTTPTransport:
|
|||
logger.debug("Received 202 Accepted")
|
||||
return
|
||||
|
||||
if response.status_code == 404: # pragma: no branch
|
||||
if isinstance(message, JSONRPCRequest): # pragma: no branch
|
||||
if response.status_code == 404:
|
||||
if isinstance(message, JSONRPCRequest):
|
||||
error_data = ErrorData(code=INVALID_REQUEST, message="Session terminated")
|
||||
session_message = SessionMessage(JSONRPCError(jsonrpc="2.0", id=message.id, error=error_data))
|
||||
await ctx.read_stream_writer.send(session_message)
|
||||
|
|
@ -492,17 +492,17 @@ class StreamableHTTPTransport:
|
|||
|
||||
async def terminate_session(self, client: httpx.AsyncClient) -> None:
|
||||
"""Terminate the session by sending a DELETE request."""
|
||||
if not self.session_id: # pragma: lax no cover
|
||||
return
|
||||
if not self.session_id:
|
||||
return # pragma: no cover
|
||||
|
||||
try:
|
||||
headers = self._prepare_headers()
|
||||
response = await client.delete(self.url, headers=headers)
|
||||
|
||||
if response.status_code == 405: # pragma: lax no cover
|
||||
if response.status_code == 405:
|
||||
logger.debug("Server does not allow session termination")
|
||||
elif response.status_code not in (200, 204): # pragma: lax no cover
|
||||
logger.warning(f"Session termination failed: {response.status_code}")
|
||||
elif response.status_code not in (200, 204):
|
||||
logger.warning(f"Session termination failed: {response.status_code}") # pragma: no cover
|
||||
except Exception as exc: # pragma: no cover
|
||||
logger.warning(f"Session termination failed: {exc}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue