Skip to content

Commit 363abdd

Browse files
committed
some more coverage
1 parent 29ff2ca commit 363abdd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_client_functional.py

+20
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,26 @@ async def handler(request):
17961796
resp.close()
17971797

17981798

1799+
async def test_payload_content_length_by_chunks(loop, test_client):
1800+
1801+
async def handler(request):
1802+
resp = web.StreamResponse(headers={'content-length': '3'})
1803+
await resp.prepare(request)
1804+
await resp.write(b'answer')
1805+
await resp.write(b'')
1806+
request.transport.close()
1807+
return resp
1808+
1809+
app = web.Application()
1810+
app.router.add_get('/', handler)
1811+
client = await test_client(app)
1812+
1813+
resp = await client.get('/')
1814+
data = await resp.read()
1815+
assert data == b'ans'
1816+
resp.close()
1817+
1818+
17991819
async def test_chunked(loop, test_client):
18001820

18011821
async def handler(request):

0 commit comments

Comments
 (0)