Skip to content

test(cli): comprehensive test suite for manus-agent poc-search subcommand (+57 tests) - #139

Open
manus-use wants to merge 1 commit into
mainfrom
test/cli-poc-search
Open

test(cli): comprehensive test suite for manus-agent poc-search subcommand (+57 tests)#139
manus-use wants to merge 1 commit into
mainfrom
test/cli-poc-search

Conversation

@manus-use

Copy link
Copy Markdown
Owner

Summary

Comprehensive test suite for the manus-agent poc-search CLI subcommand — 57 fully-mocked tests covering parser construction, main() routing, CVE ID validation, text output formatting, JSON output mode, --sources filtering, exit codes, and edge cases.

What's tested

Category Tests Coverage
Parser construction 8 Required args, default values, invalid choices, help flag
Routing 2 main() dispatches to _run_poc_search correctly
CVE ID validation 5 Valid/invalid formats, lowercase, whitespace stripping
JSON output 5 Valid JSON, empty results, exploited_in_wild, recent_activity, sources_failed
Text output 14 Header, sources, banners, table format, truncation, result counts
Sources filter 5 Empty → None, single, multiple, spaces trimmed, whitespace-only
Exit codes 5 Success (0), invalid CVE (2), json mode (0)
Edge cases 8 All sources failed, mixed exploited, long titles/URLs, empty fields, Log4Shell example

Key design decisions

  • 100% mockedaggregate_poc_results is patched at the module level; no HTTP calls
  • Tests the CLI integration contract — validates that main() correctly routes poc-search and that parser flags propagate to the underlying tool
  • Covers the README example — Log4Shell (CVE-2021-44228) scenario with exploited-in-wild + recent activity

Test results

1215 passed, 3 deselected, 0 failures

Baseline: 1158 tests + 57 new = 1215 total.

Open PRs checked (no overlap)

None of these test the poc-search CLI subcommand. The existing tests/test_search_poc_sources.py (1120 lines) tests the tool module internals, not the CLI dispatcher/formatter.

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.

1 participant