test_preparing_url() — requests Function Reference
Architecture documentation for the test_preparing_url() function in test_requests.py from the requests codebase.
Entity Profile
Dependency Diagram
graph TD a52c4073_c3a9_0831_73c5_e7d283dd7bda["test_preparing_url()"] 0e391504_f528_a095_5b1a_95d479a82586["TestPreparingURLs"] a52c4073_c3a9_0831_73c5_e7d283dd7bda -->|defined in| 0e391504_f528_a095_5b1a_95d479a82586 style a52c4073_c3a9_0831_73c5_e7d283dd7bda fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_requests.py lines 2737–2747
def test_preparing_url(self, url, expected):
def normalize_percent_encode(x):
# Helper function that normalizes equivalent
# percent-encoded bytes before comparisons
for c in re.findall(r"%[a-fA-F0-9]{2}", x):
x = x.replace(c, c.upper())
return x
r = requests.Request("GET", url=url)
p = r.prepare()
assert normalize_percent_encode(p.url) == expected
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_preparing_url() do?
test_preparing_url() is a function in the requests codebase, defined in tests/test_requests.py.
Where is test_preparing_url() defined?
test_preparing_url() is defined in tests/test_requests.py at line 2737.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free