Skip to content
Myr

test `obfuscate_sensitive_headers` via public api (#3063)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by T-256 · committed by GitHub · parent 15f9253 · Browse files · 1 file+3 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−5 removed

  • tests:+3 added−5 removed

1 file+3 added−5 removed

modified:tests/test_utils.py+3 added-5 removed
10 unmodified lines
11 URLPattern,12 get_ca_bundle_from_env,13 get_environment_proxies,14 is_https_redirect,15 obfuscate_sensitive_headers,15 parse_header_links,16 same_origin,17)18
194 unmodified lines
213 ([("proxy-authorization", "s3kr3t")], [("proxy-authorization", "[secure]")]),214 ],215)216def test_obfuscate_sensitive_headers(headers, output):218 bytes_headers = [(k.encode(), v.encode()) for k, v in headers]219 bytes_output = [(k.encode(), v.encode()) for k, v in output]220 assert list(obfuscate_sensitive_headers(headers)) == output221 assert list(obfuscate_sensitive_headers(bytes_headers)) == bytes_output217 as_dict = {k: v for k, v in output}218 headers_class = httpx.Headers({k: v for k, v in headers})219 assert repr(headers_class) == f"Headers({as_dict!r})"220221222def test_same_origin():223 origin1 = httpx.URL("https://example.com")
64 unmodified lines