mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 07:10:00 -07:00
- Split monolithic intercept.py (15k lines) into modular structure: - routes/ - Flask blueprints for each feature - templates/ - Jinja2 HTML templates - data/ - OUI database, satellite TLEs, detection patterns - utils/ - dependencies, process management, logging - config.py - centralized configuration with env var support - Add type hints to function signatures - Replace bare except clauses with specific exceptions - Add proper logging module (replaces print statements) - Add environment variable support (INTERCEPT_* prefix) - Add test suite with pytest - Add Dockerfile for containerized deployment - Add pyproject.toml with ruff/black/mypy config - Add requirements-dev.txt for development dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
40 lines
1.0 KiB
Python
40 lines
1.0 KiB
Python
"""Tests for main application routes."""
|
|
|
|
import pytest
|
|
|
|
|
|
def test_index_page(client):
|
|
"""Test that index page loads."""
|
|
response = client.get('/')
|
|
assert response.status_code == 200
|
|
assert b'INTERCEPT' in response.data
|
|
|
|
|
|
def test_dependencies_endpoint(client):
|
|
"""Test dependencies endpoint returns valid JSON."""
|
|
response = client.get('/dependencies')
|
|
assert response.status_code == 200
|
|
data = response.get_json()
|
|
assert 'modes' in data
|
|
assert 'os' in data
|
|
|
|
|
|
def test_devices_endpoint(client):
|
|
"""Test devices endpoint returns list."""
|
|
response = client.get('/devices')
|
|
assert response.status_code == 200
|
|
data = response.get_json()
|
|
assert isinstance(data, list)
|
|
|
|
|
|
def test_satellite_dashboard(client):
|
|
"""Test satellite dashboard loads."""
|
|
response = client.get('/satellite/dashboard')
|
|
assert response.status_code == 200
|
|
|
|
|
|
def test_adsb_dashboard(client):
|
|
"""Test ADS-B dashboard loads."""
|
|
response = client.get('/adsb/dashboard')
|
|
assert response.status_code == 200
|