Skip to content

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

Open
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1227
Open

test : added unit tests for CLI argument parsing and run_scan edge cases#1232
tmdeveloper007 wants to merge 1 commit 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.

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.

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

1 participant