Skip to content

test : added unit tests for BaseScanner pure helper methods#1263

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

test : added unit tests for BaseScanner pure helper methods#1263
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1258

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1258.

Summary of What Has Been Done:
Added a new test file testing/backend/unit/test_scanners_base.py covering the three non-abstract, pure helper methods on BaseScanner.

Changes Made:

  • New file: testing/backend/unit/test_scanners_base.py
  • TestUpdateProgress: 7 test cases covering boundary clamping (negative to 0, over-1 to 1.0, in-range unchanged)
  • TestGetProgress: 3 test cases for initial value and accumulation across multiple update_progress calls
  • TestNormalizeSeverity: 11 test cases covering all mapping keys (critical/high/medium/moderate/low/info/informational/note), unknown defaults, case insensitivity, and non-string inputs
  • Import the real BaseScanner class from backend.secuscan.scanners.base
  • ASCII only, no unicode, trailing newline at end of file

Impact it Made:

  • These pure, deterministic methods had zero test coverage. Tests prevent regressions as scanner plugins are extended.
  • normalize_severity is a common source of bugs when new plugins emit non-standard severity strings.

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 BaseScanner pure helper methods

1 participant