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

Method test_response_headers

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

Source from the content-addressed store, hash-verified

981 self.assertEqual(p, c.port)
982
983 def test_response_headers(self):
984 # test response with multiple message headers with the same field name.
985 text = ('HTTP/1.1 200 OK\r\n'
986 'Set-Cookie: Customer="WILE_E_COYOTE"; '
987 'Version="1"; Path="/acme"\r\n'
988 'Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1";'
989 ' Path="/acme"\r\n'
990 '\r\n'
991 'No body\r\n')
992 hdr = ('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"'
993 ', '
994 'Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme"')
995 s = FakeSocket(text)
996 r = client.HTTPResponse(s)
997 r.begin()
998 cookies = r.getheader("Set-Cookie")
999 self.assertEqual(cookies, hdr)
1000
1001 def test_read_head(self):
1002 # Test that the library doesn't attempt to read any data

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