Martin Panter added the comment:

To add a second response you would just concatenate it to the existing 
response. (Your existing test already uses FakeSocket.) The FakeSocket 
parameter just represents data that would be sent from the server. So:

body = (
   b"HTTP/1.1 200 OK\r\n"
   b"Content-Length: 3\r\n"
   b"\r\n"
   b"abc"
   b"HTTP/1.1 408 Next response should not be read yet\r\n"
)

In fact, see the BasicTest.test_content_length_sync() case, which literally has 
"extradata" as that last line. I think we just need to adapt or duplicate this 
test to cover readline() and read1(), not just read(). Maybe also with 
read1(100), readline(100) cases as well.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26499>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to