Skip to content

Commit aa298e8

Browse files
committed
remove unused code
1 parent e4ead85 commit aa298e8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_util.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ async def test_normalize_url_with_missing_url():
4646
def test_strip_user_pass_url():
4747
assert strip_user_pass_url("http://1.2.3.4/?user=foo&pass=bar") == "http://1.2.3.4/"
4848
assert strip_user_pass_url("http://1.2.3.4/") == "http://1.2.3.4/"
49+
# Test with userinfo in URL
50+
assert strip_user_pass_url("http://user:[email protected]/") == "http://1.2.3.4/"
51+
assert strip_user_pass_url("http://[email protected]/") == "http://1.2.3.4/"
52+
# Test with both userinfo and query params
53+
assert (
54+
strip_user_pass_url("http://user:[email protected]/?username=foo&password=bar")
55+
== "http://1.2.3.4/"
56+
)
4957

5058

5159
def test_obscure_user_pass_url():
@@ -54,3 +62,18 @@ def test_obscure_user_pass_url():
5462
== "http://1.2.3.4/?user=********&pass=********"
5563
)
5664
assert obscure_user_pass_url("http://1.2.3.4/") == "http://1.2.3.4/"
65+
# Test with userinfo in URL
66+
assert (
67+
obscure_user_pass_url("http://user:[email protected]/")
68+
== "http://user:********@1.2.3.4/"
69+
)
70+
assert obscure_user_pass_url("http://[email protected]/") == "http://********@1.2.3.4/"
71+
# Test with both userinfo and query params
72+
assert (
73+
obscure_user_pass_url("http://user:[email protected]/?username=foo&password=bar")
74+
== "http://user:********@1.2.3.4/?username=********&password=********"
75+
)
76+
assert (
77+
obscure_user_pass_url("http://[email protected]/?password=bar")
78+
== "http://********@1.2.3.4/?password=********"
79+
)

0 commit comments

Comments
 (0)