data = {"method": request.method, "url": request.url}
response = JSONResponse(data)
await response(receive, send)
+
return asgi
client = TestClient(app)
async def asgi(receive, send):
request = Request(scope, receive)
await request.body()
+
return asgi
async def receiver():
- return {'type': 'http.disconnect'}
+ return {"type": "http.disconnect"}
- scope = {'method': 'POST', 'path': '/'}
+ scope = {"method": "POST", "path": "/"}
asgi_callable = app(scope)
loop = asyncio.get_event_loop()
with pytest.raises(ClientDisconnect):