Current: 4.53% coverage (1,002 / 22,112 lines) Target: 80% coverage (17,690 / 22,112 lines) Gap: Need to test ~16,688 more lines
Let the agents do the work for you!
# Spawn test generation swarm
claude-code
# Then in Claude:
"Generate comprehensive tests for src/core/constants.py, src/core/engine.py, and src/core/file_host_config.py. Aim for >80% coverage with pytest. Include happy paths, error cases, and edge cases."
Step 1: Create test structure
mkdir -p tests/unit/{core,network,storage,processing}
Step 2: Start with easiest module
# Create first test file
cat > tests/unit/core/test_constants.py << 'EOF'
"""Tests for core constants."""
import pytest
from src.core.constants import *
class TestConstants:
def test_constants_exist(self):
"""Verify critical constants are defined."""
assert APP_NAME
assert VERSION
def test_constant_types(self):
"""Verify constant types."""
assert isinstance(APP_NAME, str)
assert isinstance(VERSION, str)
EOF
Step 3: Run and verify
pytest tests/unit/core/test_constants.py -v --cov=src.core.constants
Test in this order for fastest coverage gains:
src/core/constants.py (87 lines) - Easiestsrc/utils/format_utils.py (63 lines) - Pure functionssrc/utils/archive_utils.py (49 lines) - Simple logicsrc/network/cookies.py (85 lines) - Standard operationssrc/network/token_cache.py (75 lines) - Caching logicExpected gain: +359 lines (~1.6% coverage)
src/core/engine.py (371 lines) - CRITICALsrc/core/file_host_config.py (240 lines) - CRITICALsrc/storage/database.py (652 lines) - CRITICALsrc/network/client.py (177 lines) - CRITICALExpected gain: +1,440 lines (~6.5% coverage)
src/processing/tasks.py (222 lines)src/processing/rename_worker.py (274 lines)src/processing/file_host_workers.py (406 lines)src/network/file_host_client.py (887 lines)Expected gain: +1,789 lines (~8% coverage)
src/storage/queue_manager.py (694 lines)src/utils/logging.py (258 lines)src/utils/logger.py (177 lines)src/processing/upload_workers.py (317 lines)Expected gain: +1,446 lines (~6.5% coverage)
# In Claude Code:
"Generate pytest tests for src/core/engine.py with >80% coverage.
Include:
- Initialization tests
- State transition tests
- Error handling tests
- Edge cases
- Mocking for external dependencies"
# In Claude Code:
"Generate comprehensive test suite for these modules:
1. src/core/engine.py
2. src/core/file_host_config.py
3. src/storage/database.py
Requirements:
- >80% coverage per module
- pytest with fixtures
- Mock external dependencies
- Follow AAA pattern
- Include integration tests where needed"
# In Claude Code:
"Generate complete test coverage for src/network/ package.
- All modules in the package
- Unit tests for each module
- Integration tests for workflows
- >80% coverage target
- Mock HTTP requests with 'responses' library"
# Run tests
pytest tests/unit/core/test_constants.py -v
# Check coverage
pytest --cov=src.core.constants --cov-report=term
# See what's missing
pytest --cov=src.core.constants --cov-report=term-missing
# Full coverage report
pytest --cov=src --cov-report=html
# View in browser
explorer.exe htmlcov/index.html # WSL
# Update pytest.ini to require minimum coverage
# Start low, increase gradually
# Week 1: Require 10%
fail-under = 10
# Week 3: Require 30%
fail-under = 30
# Week 8: Require 80%
fail-under = 80
# Save as tests/templates/unit_test_template.py
"""Tests for {module_name}."""
import pytest
from unittest.mock import Mock, patch
from src.{module_path} import *
class Test{ClassName}:
@pytest.fixture
def setup(self):
"""Setup test fixtures."""
pass
def test_initialization(self, setup):
"""Test object initialization."""
pass
def test_happy_path(self, setup):
"""Test normal operation."""
pass
def test_error_handling(self, setup):
"""Test error cases."""
pass
Donβt try to test everything at once:
Not all code is equally important:
# Find least-covered modules
coverage report --sort=cover | head -20
# Focus on files with 0% coverage first
Result: 60% coverage in 4 weeks!
β Bad: Testing if buttons appear β Good: Testing button click handlers
β Bad: assert result == "Uploaded 5 files at 2025-11-13 10:30:15"
β
Good: assert "Uploaded 5 files" in result
β Bad: Only test happy paths β Good: Test errors, exceptions, edge cases
β Bad: Mock so much nothing real is tested β Good: Mock I/O, network, disk - test logic
# Create test structure
cd /mnt/h/cursor/bbdrop
mkdir -p tests/unit/{core,network,storage,processing}
# Create first test
cat > tests/unit/core/test_constants.py << 'EOF'
"""Tests for core constants."""
import pytest
from src.core.constants import *
def test_app_name_defined():
"""Test APP_NAME constant exists."""
assert APP_NAME
def test_version_defined():
"""Test VERSION constant exists."""
assert VERSION
EOF
# Run it
pytest tests/unit/core/test_constants.py -v
# Check coverage
pytest --cov=src.core.constants --cov-report=term
/docs/COVERAGE_ROADMAP.md - Complete 12-week plan/swarm/results/TEST_REPORT.md - Current test status/COVERAGE_QUICKSTART.md - You are here!Remember: You donβt have to do this alone. Use the swarm to generate tests automatically!
Start NOW: Copy the first command above and run it. Youβll have your first test passing in 60 seconds!