MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_read_head

Method test_read_head

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

Source from the content-addressed store, hash-verified

953 self.assertEqual(cookies, hdr)
954
955 def test_read_head(self):
956 # Test that the library doesn't attempt to read any data
957 # from a HEAD request. (Tickles SF bug #622042.)
958 sock = FakeSocket(
959 'HTTP/1.1 200 OK\r\n'
960 'Content-Length: 14432\r\n'
961 '\r\n',
962 NoEOFBytesIO)
963 resp = client.HTTPResponse(sock, method="HEAD")
964 resp.begin()
965 if resp.read():
966 self.fail("Did not expect response from HEAD request")
967
968 def test_readinto_head(self):
969 # 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