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

Method test_malformed_headers_coped_with

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

Source from the content-addressed store, hash-verified

300 self.assertStartsWith(sock.data, expected)
301
302 def test_malformed_headers_coped_with(self):
303 # Issue 19996
304 body = "HTTP/1.1 200 OK\r\nFirst: val\r\n: nval\r\nSecond: val\r\n\r\n"
305 sock = FakeSocket(body)
306 resp = client.HTTPResponse(sock)
307 resp.begin()
308
309 self.assertEqual(resp.getheader('First'), 'val')
310 self.assertEqual(resp.getheader('Second'), 'val')
311
312 def test_parse_all_octets(self):
313 # Ensure no valid header field octet breaks the parser

Callers

nothing calls this directly

Calls 4

beginMethod · 0.95
getheaderMethod · 0.95
FakeSocketClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected