Skip to content

test : added explicit None input test for scanner normalize_severity#1713

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

test : added explicit None input test for scanner normalize_severity#1713
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1708

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1708.

Summary of What Has Been Done:
Added a single test test_none_input_returns_info to testing/backend/unit/test_scanners_base.py inside the TestNormalizeSeverity class.

The existing test_non_string_input test covers numeric input (123) returning "info", but None as an explicit input value was not tested. str(None) produces "None" which is not in the severity mapping, so the function returns "info". This behavior is now made explicit.

Changes Made:

def test_none_input_returns_info(self):
    """None is a common input in real pipelines — str(None)="None" is not in the mapping, so returns "info"."""
    scanner = _ConcreteScanner("task_none", None)
    assert scanner.normalize_severity(None) == "info"

Impact it Made:

  • Documents the None input expectation explicitly
  • Prevents accidental regression if the str() coercion logic changes

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 explicit None input test for scanner normalize_severity

1 participant