Some checks failed
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>
37 lines
1.1 KiB
Python
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 == []
|