Skip to content

Improve test coverage for convert_capec.py with edge case scenarios#2879

Merged
sydseter merged 1 commit intoOWASP:masterfrom
theanand108:edge-tests-clean
Apr 25, 2026
Merged

Improve test coverage for convert_capec.py with edge case scenarios#2879
sydseter merged 1 commit intoOWASP:masterfrom
theanand108:edge-tests-clean

Conversation

@theanand108
Copy link
Copy Markdown
Contributor

Summary

This PR improves test coverage for convert_capec.py by adding targeted unit tests for previously uncovered edge cases and execution paths.

Changes

Added tests for:

  • create_capec_pages
    • Category handling with and without ASVS mapping
  • main
    • Handling of invalid input data
    • Successful execution flow

Notes

  • No functional changes were made
  • Focused only on increasing test coverage and reliability
  • All existing tests pass

Impact

  • Increased coverage of convert_capec.py to ~95%
  • Helps achieve overall coverage goals for the converter modules
  • Improves confidence in edge case handling

AI Disclosure

Parts of this contribution were developed with the assistance of AI tools (ChatGPT) for guidance on test design and edge case identification. All code has been reviewed and validated by the author.

Affirmation

I confirm that this contribution is my original work and has been tested to ensure it does not break existing functionality.

@sydseter sydseter merged commit df5ca92 into OWASP:master Apr 25, 2026
11 of 12 checks passed
@sydseter
Copy link
Copy Markdown
Collaborator

@theanand108 Thank you for bringing the coverage up to 94%

@theanand108 theanand108 deleted the edge-tests-clean branch April 25, 2026 13:06
@theanand108
Copy link
Copy Markdown
Contributor Author

The pleasure is mine :)—thanks for the support! I’ll keep working on convert.py to push coverage further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants