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

Method test_http_body_empty_seq

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

Source from the content-addressed store, hash-verified

1072 self.assertEqual(int(newreq.get_header('Content-length')), 11)
1073
1074 def test_http_body_empty_seq(self):
1075 # Zero-length iterable body should be treated like any other iterable
1076 h = urllib.request.AbstractHTTPHandler()
1077 h.parent = MockOpener()
1078 req = h.do_request_(Request("http://example.com/", ()))
1079 self.assertEqual(req.get_header("Transfer-encoding"), "chunked")
1080 self.assertFalse(req.has_header("Content-length"))
1081
1082 def test_http_body_array(self):
1083 # 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