MCPcopy
hub / github.com/encode/starlette / generator

Function generator

tests/middleware/test_gzip.py:75–77  ·  view source on GitHub ↗
(bytes: bytes, count: int)

Source from the content-addressed store, hash-verified

73def test_gzip_streaming_response(test_client_factory: TestClientFactory) -> None:
74 def homepage(request: Request) -> StreamingResponse:
75 async def generator(bytes: bytes, count: int) -> ContentStream:
76 for index in range(count):
77 yield bytes
78
79 streaming = generator(bytes=b"x" * 400, count=10)
80 return StreamingResponse(streaming, status_code=200)

Callers 1

homepageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected