Files
orion/app/modules/prospecting/tests/unit/test_stats_service.py
Samir Boulahtit 6d6eba75bf
Some checks failed
CI / pytest (push) Failing after 48m31s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
CI / ruff (push) Successful in 11s
CI / validate (push) Successful in 23s
CI / dependency-scanning (push) Successful in 28s
feat(prospecting): add complete prospecting module for lead discovery and scoring
Migrates scanning pipeline from marketing-.lu-domains app into Orion module.
Supports digital (domain scan) and offline (manual capture) lead channels
with enrichment, scoring, campaign management, and interaction tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 00:59:47 +01:00

37 lines
1.1 KiB
Python

# app/modules/prospecting/tests/unit/test_stats_service.py
"""
Unit tests for StatsService.
"""
import pytest
from app.modules.prospecting.services.stats_service import StatsService
@pytest.mark.unit
@pytest.mark.prospecting
class TestStatsService:
"""Tests for StatsService."""
def setup_method(self):
self.service = StatsService()
def test_get_overview_empty(self, db):
"""Test overview stats with no data."""
stats = self.service.get_overview(db)
assert "total_prospects" in stats
assert stats["total_prospects"] == 0
def test_get_overview_with_data(self, db, digital_prospect, offline_prospect):
"""Test overview stats with data."""
stats = self.service.get_overview(db)
assert stats["total_prospects"] >= 2
assert stats["digital_count"] >= 1
assert stats["offline_count"] >= 1
def test_get_scan_jobs_empty(self, db):
"""Test getting scan jobs when none exist."""
jobs, total = self.service.get_scan_jobs(db)
assert total == 0
assert jobs == []