Skip to content

test : added unit tests for CLI argument parsing and run_scan edge cases#1232

Merged
utksh1 merged 3 commits into
utksh1:mainfrom
tmdeveloper007:#1227
Jun 24, 2026
Merged

test : added unit tests for CLI argument parsing and run_scan edge cases#1232
utksh1 merged 3 commits into
utksh1:mainfrom
tmdeveloper007:#1227

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1227.

Summary of What Has Been Done:
Expanded testing/backend/unit/test_cli.py from 3 tests to 7, covering additional CLI edge cases not yet tested.

Changes Made:

  • test_cli_no_args_calls_print_help: verifies main() with no args calls print_help without SystemExit
  • test_run_scan_target_dot_defaults_to_secret_scanner: verifies target "." defaults to secret_scanner plugin
  • test_run_scan_task_not_found_returns_1: verifies run_scan returns 1 when DB fetch returns None after task completion
  • test_run_scan_failed_task_returns_1: verifies run_scan returns 1 when task status is failed without crashing on None structured_json
  • 7 tests total, all passing

Impact it Made:
The CLI is the user-facing entry point. Unhandled edge cases (task disappearing, failed status) would cause tracebacks instead of clean exit codes. These tests ensure graceful degradation in all failure scenarios.

Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.

@utksh1 utksh1 merged commit 775c5c2 into utksh1:main Jun 24, 2026
6 of 7 checks passed
@utksh1 utksh1 added the gssoc:approved Admin validation: approved for GSSoC scoring label Jun 24, 2026
utksh1 added a commit that referenced this pull request Jun 25, 2026
, #1234, #1232, #1231, #1230, #1229, #1228, #1222, #1221, #1254, #1252, #1251, #1250, #1242, #1255, #1090, #1097, #1112)

Reverting all PR merges performed during this session to restore repository
to pre-session state. This reverts commits:
- e376276 (#1255)
- 18e5101 (#1222)
- e516dd5 (#1230)
- be400fa (#1235)
- d522e9a (#1243)
- bc0b1cd (#1090)
- de56660 (#1097)
- c2a5a53 (#1112)
- eb30d33 (#1254)
- f2a67f7 (#1250)
- 6579112 (#1251)
- 8751d92 (#1252)
- 3ebc935 (#1221)
- 6f5a936 (#1228)
- da15da4 (#1229)
- b66a5b0 (#1231)
- 775c5c2 (#1232)
- b529ddb (#1234)
- 965b001 (#1241)
- d46e573 (#1242)
- dd09955 (#1240)

All PRs are also being reopened and gssoc labels removed.
@utksh1 utksh1 added level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label area:backend Backend API, database, or service work gssoc:approved Admin validation: approved for GSSoC scoring and removed gssoc:approved Admin validation: approved for GSSoC scoring labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work gssoc:approved Admin validation: approved for GSSoC scoring level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add unit tests for CLI argument parsing and run_scan edge cases

2 participants