Closed tnzmnjm closed 2 months ago
get_base_repo_url
function in the filetests/test_github_repo_request_local.py
repourls
ending with .git
correctly, changed the function to address thistests/__init__.py
to the tests
directoryfilter_incomplete_urls
in the script src/github_repo_request_local.py
to be able to write test cases efficientlyfilter_incomplete_urls
function to handle None
values of the repourl
Parameterisation Decorator
: @pytest.mark.parametrize
to define multiple sets of arguments (data
, expected_length
, expected_urls
) for the test function test_filter_incomplete_urls
.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
Implement Pytest Testing for
get_base_repo_url
function ingithub_repo_request_local.py
to able to test the desired behaviours with a variety of pseudo URLs.Writing test cases for
if "repourl" in df.columns: incomplete_urls = df[ df["repourl"].apply(lambda x: len(x.rstrip("/").split("/")) < 5) ]
writing test cases for
for url in incomplete_urls["repourl"]: logger.info(f"Excluding the repourl : {url}") df = df[df["repourl"].apply(lambda x: len(x.rstrip("/").split("/")) >= 5)]