commercetest / nlnet

Analysis of the opensource codebases of NLnet sponsored projects.
MIT License
0 stars 0 forks source link

70 update the tests in tests/test_github_repo_request_local.py #77

Closed tnzmnjm closed 1 month ago

tnzmnjm commented 1 month ago

Hi Julian,

Could you please review the changes and advise if there's any section you would like me to change please?

This PR introduces several updates to our test suites to improve accuracy and robustness, and it proposes a change in file naming to better reflect the content and purpose of our scripts.

Changes:

  1. Update Test Cases for extract_and_flag_domains:

    • Modified the test cases to handle pd.NA correctly, ensuring that our tests remain robust across mixed data types.
  2. Correct Test Assertions in mark_incomplete_urls:

    • Aligned the test assertions with the function's logic to accurately reflect the criteria for URL completeness, especially handling special characters within URLs.
  3. Adjust Expected Outputs in Tests:

    • Updated the expected outputs in our tests to match actual behaviour, focusing particularly on the handling of unsupported URL schemes and duplicate flags.
  4. Improve Test Coverage: Added new scenarios to our tests to thoroughly examine the interactions with the duplicate_flag and URL schemes.

  5. File Name Change:

    • Propose renaming of tests/test_github_repo_request_local.py to tests/test_initial_data_preparation.py as the test cases are written for the functions in the script initial_data_preparation.py.
  6. Wrote unit tests using PyHamcrest for the functions get_domain, is_complete_url, extract_url, and convert_http_to_https

Thanks very much

tnzmnjm commented 1 month ago

All the required changes have been done. Merging this PR to the main branch.