Skip to content

Commit

Permalink
Add failing tests for redact_netloc().
Browse files Browse the repository at this point in the history
  • Loading branch information
cjerdonek committed Oct 30, 2018
1 parent f54b68f commit 0ecc9f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ def test_split_auth_from_netloc(netloc, expected):
('user:pass@[email protected]', 'user:****@example.com'),
# Test the password containing a : symbol.
('user:pass:[email protected]', 'user:****@example.com'),
# Test URL-encoded reserved characters.
('user%3Aname:%23%40%[email protected]', 'user%3Aname:****@example.com'),
])
def test_redact_netloc(netloc, expected):
actual = redact_netloc(netloc)
Expand Down Expand Up @@ -718,7 +720,10 @@ def test_remove_auth_from_url(auth_url, expected_url):
('https://[email protected]/abc', 'https://[email protected]/abc'),
('https://user:[email protected]', 'https://user:****@example.com'),
('https://user:@example.com', 'https://user:****@example.com'),
('https://example.com', 'https://example.com')
('https://example.com', 'https://example.com'),
# Test URL-encoded reserved characters.
('https://user%3Aname:%23%40%[email protected]',
'https://user%3Aname:****@example.com'),
])
def test_redact_password_from_url(auth_url, expected_url):
url = redact_password_from_url(auth_url)
Expand Down

0 comments on commit 0ecc9f0

Please sign in to comment.