Skip to content

test : added unit tests for finding_intelligence fingerprint and evidence helpers#2079

Open
tmdeveloper007 wants to merge 5 commits into
utksh1:mainfrom
tmdeveloper007:#2074
Open

test : added unit tests for finding_intelligence fingerprint and evidence helpers#2079
tmdeveloper007 wants to merge 5 commits into
utksh1:mainfrom
tmdeveloper007:#2074

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #2074.

Summary of What Has Been Done:

Added testing/backend/unit/test_finding_intelligence_fingerprint.py with 17 unit tests covering three functions in backend/secuscan/finding_intelligence.py.

Changes Made:

_fingerprint_score (8 tests): validated/exact/strong_fuzzy/fuzzy/family/none/unknown/missing metadata cases

_finding_kind_for (7 tests): validated_issue, observation category, suspected_issue (severity/CVE/cpe_correlation), low-severity observation, empty category

_typed_evidence (6 tests): dict/non-dict items, confidence clamping, base confidence fallback, observed_at default, label title-casing

Tests pass with python3 -m pytest --noconftest.

Impact it Made:

  • Validates finding classification logic for deduplication and reporting
  • Ensures evidence normalization is consistent across scanners

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

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch stacks five distinct test submissions, including replacement of existing recency coverage, so it is not reviewable as one focused PR. Please reset it to one cohesive helper/test area, preserve existing coverage instead of rewriting it, and fix the failing backend-unit check. The older stacked PRs have been closed as superseded.

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch stacks five distinct test submissions, including replacement of existing recency coverage, so it is not reviewable as one focused PR. Please reset it to one cohesive helper/test area, preserve existing coverage instead of rewriting it, and fix the failing backend-unit check. The older stacked PRs have been closed as superseded.

@utksh1 utksh1 added the area:ci CI, tooling, or automation work label Jul 24, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch is a stack of five unrelated test PRs and also reduces existing _recency_detail coverage. Please split it into independent branches from current main, preserve the existing recency tests, and fix the failing backend-unit check. The fingerprint cases must remain aligned with the current 0.0 unknown-strength behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work area:ci CI, tooling, or automation work level:intermediate 35 pts difficulty label for moderate contributor PRs type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add unit tests for fingerprint_score and related helpers in finding_intelligence

2 participants