tests(generate-cve-json): cover normalise_severity, to_html, build_descriptions, build_cna_container, emit_json#235
Merged
Conversation
…scriptions, build_cna_container, emit_json 35 new tests filling the remaining gaps in test_generate_cve_json.py: - normalise_severity: known values lowercased, unknown values stripped, mixed-case handling - to_html: HTML escaping of <, >, &, newline conversion (\n\n → <br><br>, \n → <br>), Windows line-ending normalisation - build_descriptions: empty input, lang/value/supportingMedia shape, HTML escaping in media vs plain text in value field - build_cna_container: all required keys present, title/org-id/discovery wiring, affected/descriptions/metrics/problemTypes/credits/references delegation, advisory_urls and product_overrides forwarding, empty severity/cwe produce empty lists, mailing-list URL excluded - emit_json: returns sorted indented JSON, file write with parent-dir creation, trailing newline, return value matches file content, non-ASCII preserved https://claude.ai/code/session_01WEx58ofmTyCe2YhCppV3qN
This reverts commit 129cb69.
potiuk
approved these changes
May 20, 2026
Member
|
the more determinstic tests -> the better |
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.
35 new tests filling the remaining coverage gaps in
test_generate_cve_json.py.Changes
tests/test_generate_cve_json.py— new test cases covering:normalise_severity— known values lowercased, unknown values stripped, mixed-case handlingto_html— HTML escaping of<,>,&; newline conversion (\n\n→<br><br>,\n→<br>); Windows line-ending normalisationbuild_descriptions— empty input, lang/value/supportingMedia shape, HTML escaping in media vs plain text in value fieldbuild_cna_container— all required keys present; title/org-id/discovery wiring; affected/descriptions/metrics/problemTypes/credits/references delegation;advisory_urlsandproduct_overridesforwarding; empty severity/cwe produce empty lists; mailing-list URL excludedemit_json— returns sorted indented JSON, file write with parent-dir creation, trailing newline, return value matches file content, non-ASCII preserved