MCPcopy
hub / github.com/psf/requests / test_fixes_1329

Method test_fixes_1329

tests/test_requests.py:1603–1612  ·  view source on GitHub ↗

Ensure that header updates are done case-insensitively.

(self, httpbin)

Source from the content-addressed store, hash-verified

1601 assert r.status_code == 200
1602
1603 def test_fixes_1329(self, httpbin):
1604 """Ensure that header updates are done case-insensitively."""
1605 s = requests.Session()
1606 s.headers.update({"ACCEPT": "BOGUS"})
1607 s.headers.update({"accept": "application/json"})
1608 r = s.get(httpbin("get"))
1609 headers = r.request.headers
1610 assert headers["accept"] == "application/json"
1611 assert headers["Accept"] == "application/json"
1612 assert headers["ACCEPT"] == "application/json"
1613
1614 def test_uppercase_scheme_redirect(self, httpbin):
1615 parts = urlparse(httpbin("html"))

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
httpbinFunction · 0.85
updateMethod · 0.80

Tested by

no test coverage detected