MCPcopy Create free account
hub / github.com/Azure-Samples/rag-postgres-openai-python / handle

Function handle

tests/e2e.py:61–68  ·  view source on GitHub ↗
(route: Route)

Source from the content-addressed store, hash-verified

59def test_chat(page: Page, live_server_url: str):
60 # Set up a mock route to the /chat endpoint with streaming results
61 def handle(route: Route):
62 # Read the JSONL from our snapshot results and return as the response
63 f = open(
64 "tests/snapshots/test_api_routes/test_advanced_chat_streaming_flow/advanced_chat_streaming_flow_response.jsonlines"
65 )
66 jsonl = f.read()
67 f.close()
68 route.fulfill(body=jsonl, status=200, headers={"Transfer-encoding": "Chunked"})
69
70 page.route("*/**/chat/stream", handle)
71

Callers

nothing calls this directly

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected