Improve test coverage for capec_map_enricher and add edge case handling#2881
Merged
sydseter merged 2 commits intoOWASP:masterfrom Apr 26, 2026
Merged
Improve test coverage for capec_map_enricher and add edge case handling#2881sydseter merged 2 commits intoOWASP:masterfrom
sydseter merged 2 commits intoOWASP:masterfrom
Conversation
…es (black/flake8)
sydseter
approved these changes
Apr 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR improves test coverage for
capec_map_enricher.pyby adding edge case tests and handling previously untested scenarios. It also includes formatting fixes to satisfy linting requirements.Changes
Added unit tests for:
Improved robustness of:
capec_map_enricher.pyfrom ~83% to ~93%load_yaml_fileby handling empty and exception casesmainflow for better error handlingApplied formatting fixes using:
black(line length 120)flake8complianceResult
capec_map_enricher.pyThis helps ensure stability when processing malformed or unexpected input data.
AI Disclosure
Some assistance from AI tools was used for brainstorming edge cases and improving test coverage. All changes were reviewed, validated, and tested manually.
Affirmation
I confirm that this contribution follows the project guidelines and that I have tested all changes locally.