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

Method test_response_headers

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

Source from the content-addressed store, hash-verified

935 self.assertEqual(p, c.port)
936
937 def test_response_headers(self):
938 # test response with multiple message headers with the same field name.
939 text = ('HTTP/1.1 200 OK\r\n'
940 'Set-Cookie: Customer="WILE_E_COYOTE"; '
941 'Version="1"; Path="/acme"\r\n'
942 'Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1";'
943 ' Path="/acme"\r\n'
944 '\r\n'
945 'No body\r\n')
946 hdr = ('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"'
947 ', '
948 'Part_Number="Rocket_Launcher_0001"; Version="1"; Path="/acme"')
949 s = FakeSocket(text)
950 r = client.HTTPResponse(s)
951 r.begin()
952 cookies = r.getheader("Set-Cookie")
953 self.assertEqual(cookies, hdr)
954
955 def test_read_head(self):
956 # 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