Added test cases for get_base_repo_url function in the file tests/test_github_repo_request_local.py
Tests will assert the result of:
Typical GitHub repository URLs with and without '.git' suffix.
URLs pointing to issues and other non-repository pages to test correct base URL extraction.
URLs from other code hosting platforms to ensure versatility.
Edge cases including invalid URLs and URLs with query parameters or fragments.
Empty and None input scenarios to validate function robustness.
defined the function filter_incomplete_urls in the script src/github_repo_request_local.py to be able to write test cases efficiently
adde a helper function inside the filter_incomplete_urls function to handle None values of the repourl
changed the function filter_incomplete_urls to check if the input url is any type other than string (includes None)
wrote a new parametrised test block (@pytest.mark.parametrize("data, expected_length") for testing different data types, all entries being non-string types, mixed valid URLs and non-string types
Added parameterised tests for URL validation with special characters testing for URLs containing unencoded special characters such as single quotes, angle brackets, spaces, and double quotes, to verify that they are correctly identified as invalid.
I am also working on adding CLI arguments for the input and output data
get_base_repo_url
function in the filetests/test_github_repo_request_local.py
filter_incomplete_urls
in the scriptsrc/github_repo_request_local.py
to be able to write test cases efficientlyfilter_incomplete_urls
function to handleNone
values of therepourl
filter_incomplete_urls
to check if the input url is any type other than string (includesNone
)@pytest.mark.parametrize("data, expected_length"
) for testing different data types, all entries being non-string types, mixed valid URLs and non-string types