Commit 363abdd 1 parent 29ff2ca commit 363abdd Copy full SHA for 363abdd
File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1796,6 +1796,26 @@ async def handler(request):
1796
1796
resp .close ()
1797
1797
1798
1798
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
+
1799
1819
async def test_chunked (loop , test_client ):
1800
1820
1801
1821
async def handler (request ):
You can’t perform that action at this time.
0 commit comments