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

Method test_read_head

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

Source from the content-addressed store, hash-verified

999 self.assertEqual(cookies, hdr)
1000
1001 def test_read_head(self):
1002 # Test that the library doesn't attempt to read any data
1003 # from a HEAD request. (Tickles SF bug #622042.)
1004 sock = FakeSocket(
1005 'HTTP/1.1 200 OK\r\n'
1006 'Content-Length: 14432\r\n'
1007 '\r\n',
1008 NoEOFBytesIO)
1009 resp = client.HTTPResponse(sock, method="HEAD")
1010 resp.begin()
1011 if resp.read():
1012 self.fail("Did not expect response from HEAD request")
1013
1014 def test_readinto_head(self):
1015 # Test that the library doesn't attempt to read any data

Callers

nothing calls this directly

Calls 4

beginMethod · 0.95
readMethod · 0.95
FakeSocketClass · 0.70
failMethod · 0.45

Tested by

no test coverage detected