Skip to content

Commit 0220077

Browse files
committed
Add support and tests to cover invalid URLs and URLs with whitespaces.
If a get request is attempted to the UrlBox API with an invalid URL then an InvalidUrlException is raised, before the call is made to the API. This allows the user to deal with the invalid URL themselves. This uses the validator package to validate URLs. If a URL with whitespace before or after the URL is passed in to the get request, these are stripped before validation, encoding and finally the get request is made. refs: https://validators.readthedocs.io/en/latest/
1 parent 065b240 commit 0220077

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_urlbox_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_get_successful():
8383

8484

8585
# valid url but with white spaces before and after
86-
def test_get_successful():
86+
def test_get_successful_white_space_url():
8787
api_key = fake.pystr()
8888

8989
format = random.choice(

0 commit comments

Comments
 (0)