Skip to content

test : added unit tests for PortScanner input resolution helpers#1264

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

test : added unit tests for PortScanner input resolution helpers#1264
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1259

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1259.

Summary of What Has Been Done:
Added a new test file testing/backend/unit/test_port_scanner_helpers.py covering the two static pure helpers on PortScanner.

Changes Made:

  • New file: testing/backend/unit/test_port_scanner_helpers.py
  • TestResolveScanType: 16 test cases covering bare S/T/U, lowercase, dash-prefixed (-sT), bare sT, whitespace, empty/None defaults to T, and all invalid value patterns raising ValueError
  • TestResolvePorts: 19 test cases covering None/empty/top100 to empty string, top1000/all to ranges, numeric passthrough, comma-separated specs, and invalid patterns raising ValueError
  • Import PortScanner from backend.secuscan.scanners.port_scanner
  • ASCII only, no unicode, trailing newline at end of file

Impact it Made:

  • These helpers normalise user input before building nmap plugin commands. Incorrect outputs silently produce wrong scan results.
  • No existing tests covered this module.

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 PortScanner input resolution helpers

1 participant