Skip to content

test : added unit tests for Settings field validation edge cases#1267

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

test : added unit tests for Settings field validation edge cases#1267
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1262

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1262.

Summary of What Has Been Done:
Extended the existing testing/backend/unit/test_config_settings.py with 14 new test cases covering edge cases not addressed by the original 15 tests.

Changes Made:

  • Extended: testing/backend/unit/test_config_settings.py (+122 lines)
  • allowed_networks: wildcard CIDR patterns (192.168.., 10...*), defaults, single value, empty list
  • cors_allowed_origins: multiple origins, default localhost, empty list
  • file path defaults: database_path, data_dir, reports_dir all resolve inside PROJECT_ROOT
  • no-env-vars instantiation: Settings() works with zero kwargs
  • sandbox settings: defaults present, env override via kwargs
  • Total: 29 tests now (15 existing + 14 new), all passing

Impact it Made:

  • allowed_networks wildcards are used by the egress validation system to permit or block scan targets. Incorrect wildcard parsing silently allows unintended targets.
  • The original test file covered basic instantiation but not field-level edge cases.

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 Settings field validation edge cases

1 participant