From 91752990d5863526745e5c31cfb4b7459d11047e Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 24 Jul 2012 11:39:49 +1200 Subject: Handle HTTP responses that have a body but no content-length or transfer encoding We check if the server sent a connection:close header, and read till the socket closes. Closes #2 --- test/test_tcp.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/test_tcp.py') diff --git a/test/test_tcp.py b/test/test_tcp.py index d6235b01..67c56a37 100644 --- a/test/test_tcp.py +++ b/test/test_tcp.py @@ -239,3 +239,9 @@ class TestFileLike: s = cStringIO.StringIO("foobar\nfoobar") s = tcp.FileLike(s) assert s.readline(3) == "foo" + + def test_limitless(self): + s = cStringIO.StringIO("f"*(50*1024)) + s = tcp.FileLike(s) + ret = s.read(-1) + assert len(ret) == 50 * 1024 -- cgit v1.2.3