Summary of What Needs to be Done:
Add an explicit unit test for BaseScanner.normalize_severity handling None input in backend/secuscan/scanners/base.py. The existing test_non_string_input test covers numeric input (123) but does not explicitly test None. The current behavior converts None via str(None) which produces "None" — not a known severity key — so the function returns "info". This should be made explicit.
Changes that Need to be Made:
In testing/backend/unit/test_scanners_base.py, add a new test method inside the existing TestNormalizeSeverity class:
def test_none_input_returns_info(self):
scanner = _ConcreteScanner("task_none", None)
assert scanner.normalize_severity(None) == "info"
Or as a standalone test function:
def test_normalize_severity_none_input():
scanner = _ConcreteScanner("task_none", None)
assert scanner.normalize_severity(None) == "info"
The _ConcreteScanner helper class is already defined in the test file. Import BaseScanner from backend.secuscan.scanners.base.
Impact that it would Provide:
- Clarity:
None is a common input in real pipelines and the expectation should be documented explicitly
- Regression safety: ensures the
str(None) behavior does not accidentally change
Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.
Summary of What Needs to be Done:
Add an explicit unit test for
BaseScanner.normalize_severityhandlingNoneinput inbackend/secuscan/scanners/base.py. The existingtest_non_string_inputtest covers numeric input (123) but does not explicitly testNone. The current behavior convertsNoneviastr(None)which produces"None"— not a known severity key — so the function returns"info". This should be made explicit.Changes that Need to be Made:
In
testing/backend/unit/test_scanners_base.py, add a new test method inside the existingTestNormalizeSeverityclass:Or as a standalone test function:
The
_ConcreteScannerhelper class is already defined in the test file. ImportBaseScannerfrombackend.secuscan.scanners.base.Impact that it would Provide:
Noneis a common input in real pipelines and the expectation should be documented explicitlystr(None)behavior does not accidentally changeNote: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.