Conversation
Add tests/test_obtain_cves.py covering all functions in the obtain_cves tool module with fully mocked HTTP calls: - _get_all_cves_from_nvd: pagination, empty response, URL construction, severity filters, results-per-page - _get_all_cves_from_github: pagination via Link headers, advisory-to-CVE mapping, missing cve_id filtering, connection/HTTP error handling - _filter_cves_by_epss: score threshold, percentile threshold, boundary values, mixed results, missing EPSS data, batch URL construction - _enrich_with_cisa_kev: KEV/non-KEV marking, mixed results, empty KEV feed, mutation behavior - _submit_in_batches: per-CVE posting, field formatting, missing optional data, description extraction, CPE/product extraction, empty input, batch chunking - obtain_cves tool handler: success path, no-CVEs-found, NVD+GitHub deduplication, error handling, EPSS chunking, content structure - TOOL_SPEC validation: name, description, required fields, types - vd_agent integration: module reference verification All 56 tests pass. Zero network calls. 1214 total tests passing.
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
Adds
tests/test_obtain_cves.py— a comprehensive test suite for theobtain_cvestool module (src/manus_agent/tools/obtain_cves.py). All HTTP calls are fully mocked — zero real network traffic.What's Tested
_get_all_cves_from_nvd(6 tests)_get_all_cves_from_github(8 tests)Linkheader) responsescve_id_filter_cves_by_epss(11 tests)> 0.05)> 0.5)_enrich_with_cisa_kev(6 tests)_submit_in_batches(10 tests)obtain_cvestool handler (11 tests)TOOL_SPEC + Integration (6 tests)
vd_agentmodule referencesobtain_cvesResults
All checks pass:
ruff check,ruff format,pytest.