Home / Function/ test_response_reason_unicode_fallback() — requests Function Reference

test_response_reason_unicode_fallback() — requests Function Reference

Architecture documentation for the test_response_reason_unicode_fallback() function in test_requests.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  c27b58aa_5f87_6ac6_0e39_866d76bf7d75["test_response_reason_unicode_fallback()"]
  22b80b19_26d4_cd0e_c476_3edf87b3df14["TestRequests"]
  c27b58aa_5f87_6ac6_0e39_866d76bf7d75 -->|defined in| 22b80b19_26d4_cd0e_c476_3edf87b3df14
  style c27b58aa_5f87_6ac6_0e39_866d76bf7d75 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_requests.py lines 1462–1472

    def test_response_reason_unicode_fallback(self):
        # check raise_status falls back to ISO-8859-1
        r = requests.Response()
        r.url = "some url"
        reason = "Komponenttia ei löydy"
        r.reason = reason.encode("latin-1")
        r.status_code = 500
        r.encoding = None
        with pytest.raises(requests.exceptions.HTTPError) as e:
            r.raise_for_status()
        assert reason in e.value.args[0]

Domain

Subdomains

Frequently Asked Questions

What does test_response_reason_unicode_fallback() do?
test_response_reason_unicode_fallback() is a function in the requests codebase, defined in tests/test_requests.py.
Where is test_response_reason_unicode_fallback() defined?
test_response_reason_unicode_fallback() is defined in tests/test_requests.py at line 1462.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free