Skip to content

Commit

Permalink
test obfuscate_sensitive_headers via public api (#3063)
Browse files Browse the repository at this point in the history
  • Loading branch information
T-256 authored Jan 16, 2024
1 parent 15f9253 commit c7cd6aa
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
get_ca_bundle_from_env,
get_environment_proxies,
is_https_redirect,
obfuscate_sensitive_headers,
parse_header_links,
same_origin,
)
Expand Down Expand Up @@ -215,10 +214,9 @@ def test_get_environment_proxies(environment, proxies):
],
)
def test_obfuscate_sensitive_headers(headers, output):
bytes_headers = [(k.encode(), v.encode()) for k, v in headers]
bytes_output = [(k.encode(), v.encode()) for k, v in output]
assert list(obfuscate_sensitive_headers(headers)) == output
assert list(obfuscate_sensitive_headers(bytes_headers)) == bytes_output
as_dict = {k: v for k, v in output}
headers_class = httpx.Headers({k: v for k, v in headers})
assert repr(headers_class) == f"Headers({as_dict!r})"


def test_same_origin():
Expand Down

0 comments on commit c7cd6aa

Please sign in to comment.