Add invalid url and whitespace url support #10
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's this PR do?
Adds support and tests to cover invalid URLs and URLs with whitespaces.Looks like this work was merged in during rebasing...
So now this just renames the function in the test suite testing for handling urls with whitespace, so it's unique.
test_get_successful() -> test_get_successful_white_space_url()
Background context
If a get request is attempted to the UrlBox API with an invalid URL thenan 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 getrequest, these are stripped before validation, encoding and finally theget request is made.refs:https://validators.readthedocs.io/en/latest/