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

Method test_http_body_array

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

Source from the content-addressed store, hash-verified

1063 self.assertFalse(req.has_header("Content-length"))
1064
1065 def test_http_body_array(self):
1066 # array.array Iterable - Content Length is calculated
1067
1068 h = urllib.request.AbstractHTTPHandler()
1069 o = h.parent = MockOpener()
1070
1071 iterable_array = array.array("I",[1,2,3,4])
1072
1073 for headers in {}, {"Content-Length": 16}:
1074 req = Request("http://example.com/", iterable_array, headers)
1075 newreq = h.do_request_(req)
1076 self.assertEqual(int(newreq.get_header('Content-length')),16)
1077
1078 def test_http_handler_global_debuglevel(self):
1079 with mock.patch.object(http.client.HTTPConnection, 'debuglevel', 6):

Callers

nothing calls this directly

Calls 5

do_request_Method · 0.95
RequestClass · 0.90
MockOpenerClass · 0.85
assertEqualMethod · 0.45
get_headerMethod · 0.45

Tested by

no test coverage detected