MCPcopy Index your code
hub / github.com/python/cpython / test_chunked_head

Method test_chunked_head

Lib/test/test_httplib.py:1226–1244  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1224 resp.close()
1225
1226 def test_chunked_head(self):
1227 chunked_start = (
1228 'HTTP/1.1 200 OK\r\n'
1229 'Transfer-Encoding: chunked\r\n\r\n'
1230 'a\r\n'
1231 'hello world\r\n'
1232 '1\r\n'
1233 'd\r\n'
1234 )
1235 sock = FakeSocket(chunked_start + last_chunk + chunked_end)
1236 resp = client.HTTPResponse(sock, method="HEAD")
1237 resp.begin()
1238 self.assertEqual(resp.read(), b'')
1239 self.assertEqual(resp.status, 200)
1240 self.assertEqual(resp.reason, 'OK')
1241 self.assertTrue(resp.isclosed())
1242 self.assertFalse(resp.closed)
1243 resp.close()
1244 self.assertTrue(resp.closed)
1245
1246 def test_readinto_chunked_head(self):
1247 chunked_start = (

Callers

nothing calls this directly

Calls 8

beginMethod · 0.95
readMethod · 0.95
isclosedMethod · 0.95
closeMethod · 0.95
assertTrueMethod · 0.80
assertFalseMethod · 0.80
FakeSocketClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected