MCPcopy
hub / github.com/scrapy/scrapy / test_headers

Method test_headers

tests/test_utils_request.py:347–359  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

345 self._test_request(request_object, expected_curl_command)
346
347 def test_headers(self):
348 request_object = Request(
349 "https://www.httpbin.org/post",
350 method="POST",
351 headers={"Content-Type": "application/json", "Accept": "application/json"},
352 body=json.dumps({"foo": "bar"}),
353 )
354 expected_curl_command = (
355 "curl -X POST https://www.httpbin.org/post"
356 ' --data-raw \'{"foo": "bar"}\''
357 " -H 'Content-Type: application/json' -H 'Accept: application/json'"
358 )
359 self._test_request(request_object, expected_curl_command)
360
361 def test_cookies_dict(self):
362 request_object = Request(

Callers

nothing calls this directly

Calls 2

_test_requestMethod · 0.95
RequestClass · 0.90

Tested by

no test coverage detected