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

Method test_http_body_empty_seq

Lib/test/test_urllib2.py:1057–1063  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1055 self.assertEqual(int(newreq.get_header('Content-length')), 11)
1056
1057 def test_http_body_empty_seq(self):
1058 # Zero-length iterable body should be treated like any other iterable
1059 h = urllib.request.AbstractHTTPHandler()
1060 h.parent = MockOpener()
1061 req = h.do_request_(Request("http://example.com/", ()))
1062 self.assertEqual(req.get_header("Transfer-encoding"), "chunked")
1063 self.assertFalse(req.has_header("Content-length"))
1064
1065 def test_http_body_array(self):
1066 # array.array Iterable - Content Length is calculated

Callers

nothing calls this directly

Calls 7

do_request_Method · 0.95
RequestClass · 0.90
MockOpenerClass · 0.85
assertFalseMethod · 0.80
assertEqualMethod · 0.45
get_headerMethod · 0.45
has_headerMethod · 0.45

Tested by

no test coverage detected