Initial commit
This commit is contained in:
33
tests/test_body.py
Normal file
33
tests/test_body.py
Normal file
@@ -0,0 +1,33 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user