Files
PlanetaryTime/tests/test_body.py

34 lines
845 B
Python
Raw Permalink Normal View History

2026-04-16 17:52:59 +02:00
from planetarytime import Body
def test_mars_hours_per_sol() -> None:
assert Body.MARS.hours_per_sol == 25
def test_jupiter_hours_per_sol() -> None:
assert Body.JUPITER.hours_per_sol == 10
def test_hours_per_sol_equals_rounded_rotation() -> None:
for body in Body:
assert body.hours_per_sol == round(body.rotation_hours)
def test_all_bodies_have_positive_rotation() -> None:
for body in Body:
assert body.rotation_hours > 0
def test_mars_sols_per_year() -> None:
assert Body.MARS.sols_per_year == 670
def test_all_bodies_have_positive_sols_per_year() -> None:
for body in Body:
assert body.sols_per_year > 0
def test_sols_per_year_derived_from_orbital_and_rotation() -> None:
for body in Body:
assert body.sols_per_year == round(body.orbital_hours / body.rotation_hours)