Files
planeMapper/tests/test_pipeline.py
T
Matt Edholm 25076dc1f3 feat(2-6): stateful Renderer, DisplayInterface, and pipeline smoke test
Implements story 2-6: Renderer class with per-aircraft trail history
(deque capped at TRAIL_MAX_DOTS=5), NullDisplay with DEBUG logging,
WaveshareDisplay stub, and end-to-end pipeline smoke test. All 96
tests pass; ruff check and format clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:33:36 -04:00

33 lines
1.0 KiB
Python

from __future__ import annotations
import pathlib
import pytest
from PIL import Image
from planemapper.display import NullDisplay
from planemapper.fetcher import FileFixtureFetcher
from planemapper.renderer.projection import MapBounds
from planemapper.renderer.renderer import Renderer
FIXTURE_DIR = pathlib.Path(__file__).parent / "fixtures"
def test_full_pipeline_smoke(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr(
"planemapper.renderer.airspace.AIRSPACE_PATH",
FIXTURE_DIR / "airspace_sample.geojson",
)
base_map = Image.new("RGB", (800, 480), color=(255, 255, 255))
bounds = MapBounds(home_lat=53.0, home_lon=-6.0, radius_nm=100.0)
fetcher = FileFixtureFetcher(FIXTURE_DIR / "aircraft_sample.json")
renderer = Renderer(base_map, bounds)
display = NullDisplay()
aircraft_list = fetcher.fetch()
result = renderer.render(aircraft_list)
assert isinstance(result, Image.Image)
assert result.size == (800, 480)
display.show(result) # should not raise