test(tools): comprehensive test suite for search_for_exploits module (+53 tests) - #181
Open
manus-use wants to merge 1 commit into
Open
test(tools): comprehensive test suite for search_for_exploits module (+53 tests)#181manus-use wants to merge 1 commit into
manus-use wants to merge 1 commit into
Conversation
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 a comprehensive test suite for the
search_for_exploitsmodule (src/manus_agent/tools/search_for_exploits.py) — 53 fully-mocked tests covering all code paths in this security-critical GitHub PoC search tool.What's tested
Why this matters
search_for_exploitsis a security-critical tool that searches GitHub for public Proof-of-Concept exploits. It handles authentication tokens, makes network requests, and parses untrusted JSON responses. Despite this, it had zero dedicated test coverage (only 2 importability checks in unrelated files). This suite covers:Test design notes
requests.getcalls are mockedTestOutputLoggingclass avoidsassert_called_oncepatterns that break whentest_packageability.py(which usesimportlib._fresh_import) runs earlier in the suite and invalidates module-level mock patchesConfig.from_file()is mocked to prevent filesystem dependenciesExisting PRs checked (no overlap)
get_github_advisoryandsearch_for_exploitshelpers — but only 2 importability/wiring checks, not functional testshttp_requesttruncation wrapper (different module)search_exploit_db,search_packetstorm,get_cwe_details(different modules)query_threat_intelligence_feeds(different module)search_for_exploitsfunctional test coverageThis is the first dedicated functional test suite for
search_for_exploits.Test results
Baseline: 1158 tests. New: 53 tests. All pass, ruff check/format clean.