Skip to content

Commit 035eeab

Browse files
add unit test
1 parent a67a1bd commit 035eeab

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_auth.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,11 @@ def test_ignore_netrc_null_auth():
153153
env=MockEnvironment(),
154154
)
155155
assert isinstance(args.auth, ExplicitNullAuth)
156+
157+
def test_percent_encoded_credentials_in_url(httpbin_both):
158+
encoded_url = httpbin_both.url.replace("://", "://u%40d:1%3d2%3f@") + '/basic-auth/u%40d/1%3d2%3f'
159+
160+
r = http('GET', encoded_url)
161+
162+
assert HTTP_OK in r
163+
assert r.json == {'authenticated': True, 'user': 'u@d'}

0 commit comments

Comments
 (0)