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

Method test_chunked_head

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

Source from the content-addressed store, hash-verified

1178 resp.close()
1179
1180 def test_chunked_head(self):
1181 chunked_start = (
1182 'HTTP/1.1 200 OK\r\n'
1183 'Transfer-Encoding: chunked\r\n\r\n'
1184 'a\r\n'
1185 'hello world\r\n'
1186 '1\r\n'
1187 'd\r\n'
1188 )
1189 sock = FakeSocket(chunked_start + last_chunk + chunked_end)
1190 resp = client.HTTPResponse(sock, method="HEAD")
1191 resp.begin()
1192 self.assertEqual(resp.read(), b'')
1193 self.assertEqual(resp.status, 200)
1194 self.assertEqual(resp.reason, 'OK')
1195 self.assertTrue(resp.isclosed())
1196 self.assertFalse(resp.closed)
1197 resp.close()
1198 self.assertTrue(resp.closed)
1199
1200 def test_readinto_chunked_head(self):
1201 chunked_start = (

Callers

nothing calls this directly

Calls 8

beginMethod · 0.95
readMethod · 0.95
isclosedMethod · 0.95
closeMethod · 0.95
assertTrueMethod · 0.80
assertFalseMethod · 0.80
FakeSocketClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected