Home / Function/ test_url_mutation() — requests Function Reference

test_url_mutation() — requests Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  3d07ba58_8742_38e0_e23f_a48761711a99["test_url_mutation()"]
  0e391504_f528_a095_5b1a_95d479a82586["TestPreparingURLs"]
  3d07ba58_8742_38e0_e23f_a48761711a99 -->|defined in| 0e391504_f528_a095_5b1a_95d479a82586
  style 3d07ba58_8742_38e0_e23f_a48761711a99 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_requests.py lines 2794–2803

    def test_url_mutation(self, input, expected):
        """
        This test validates that we correctly exclude some URLs from
        preparation, and that we handle others. Specifically, it tests that
        any URL whose scheme doesn't begin with "http" is left alone, and
        those whose scheme *does* begin with "http" are mutated.
        """
        r = requests.Request("GET", url=input)
        p = r.prepare()
        assert p.url == expected

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free