equal
deleted
inserted
replaced
132 chunkedblock('hi '), |
132 chunkedblock('hi '), |
133 ] + list(chunkedblock('there\n' * 5)) + [chunkedblock('')] |
133 ] + list(chunkedblock('there\n' * 5)) + [chunkedblock('')] |
134 con.request('GET', '/') |
134 con.request('GET', '/') |
135 self.assertStringEqual('hi there\nthere\nthere\nthere\nthere\n', |
135 self.assertStringEqual('hi there\nthere\nthere\nthere\nthere\n', |
136 con.getresponse().read()) |
136 con.getresponse().read()) |
|
137 |
|
138 def testChunkedDownloadEarlyHangup(self): |
|
139 con = http.HTTPConnection('1.2.3.4:80') |
|
140 con._connect() |
|
141 sock = con.sock |
|
142 broken = chunkedblock('hi'*20)[:-1] |
|
143 sock.data = ['HTTP/1.1 200 OK\r\n', |
|
144 'Server: BogusServer 1.0\r\n', |
|
145 'transfer-encoding: chunked', |
|
146 '\r\n\r\n', |
|
147 broken, |
|
148 ] |
|
149 sock.close_on_empty = True |
|
150 con.request('GET', '/') |
|
151 resp = con.getresponse() |
|
152 self.assertRaises(http.HTTPRemoteClosedError, resp.read) |
137 # no-check-code |
153 # no-check-code |