Skip to content

Add coordinate math unit tests#9

Open
billmallard wants to merge 3 commits into
makerplane:masterfrom
billmallard:master
Open

Add coordinate math unit tests#9
billmallard wants to merge 3 commits into
makerplane:masterfrom
billmallard:master

Conversation

@billmallard
Copy link
Copy Markdown

Summary

  • Adds tests/conftest.py — Qt stub fixtures enabling headless test execution without a display or Qt install
  • Adds tests/test_coordinate_math.py — 25 pytest tests covering Distance(), Heading(), GetRelLng(), and constants
  • Tests verify the spherical approximation math (1° lat = 60 NM, longitude compression via cos(lat)), heading quadrant coverage, and asymmetry behavior of Distance() w.r.t. start latitude
  • All 25 tests pass with zero modifications to production code

Test plan

  • cd tests && pip install pytest && pytest -v — all 25 tests should pass
  • No Qt or display required; conftest.py stubs out PyQt5 before import

🤖 Generated with Claude Code

billmallard and others added 3 commits April 18, 2026 06:36
Tests Distance(), Heading(), GetRelLng(), and adjusted_polar_deltas()
with known reference values: equator/60°/45° latitude cases, cardinal
headings, 3-4-5 Pythagorean distance check, and longitude compression.
Includes conftest.py with Qt/avchart_proj stubs for headless execution.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant