Skip to content

test : add unit tests for get_delivery_configuration in notification_service #1706

Description

@tmdeveloper007

Summary of What Needs to be Done:

Add unit tests for get_delivery_configuration in backend/secuscan/notification_service.py. This function returns a static configuration dict for webhook delivery timeouts and retry settings. It currently has no test coverage.

The function returns:

{
    "webhook_timeout_seconds": _WEBHOOK_TIMEOUT_SECONDS,
    "webhook_connect_timeout_seconds": _WEBHOOK_CONNECT_TIMEOUT_SECONDS,
    "max_retries": 0,
    "backoff_factor_seconds": 0.0,
}

Changes that Need to be Made:

Create testing/backend/unit/test_notification_service_delivery_config.py with:

  • test_returns_expected_keys: verify the dict contains webhook_timeout_seconds, webhook_connect_timeout_seconds, max_retries, backoff_factor_seconds
  • test_values_are_correct_types: webhook_timeout_seconds and webhook_connect_timeout_seconds are positive integers; max_retries is 0; backoff_factor_seconds is 0.0
  • test_returns_new_dict_each_call: calling the function twice returns equal-but-distinct dict objects (no shared mutable state)

Import get_delivery_configuration from backend.secuscan.notification_service.

Impact that it would Provide:

  • Reliability: the configuration values are used by the delivery pipeline — tests prevent accidental regressions
  • Coverage: brings this production module line under test

Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions