File size: 819 Bytes
b99b9ee | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | from __future__ import annotations
from physix.systems.registry import (
SUPPORTED_SYSTEMS,
SYSTEM_REGISTRY,
get_system,
list_supported_systems,
)
def test_supported_systems_is_non_empty() -> None:
assert len(SUPPORTED_SYSTEMS) > 0
def test_supported_systems_only_references_registered_systems() -> None:
for system_id in SUPPORTED_SYSTEMS:
assert system_id in SYSTEM_REGISTRY
def test_list_supported_systems_preserves_declared_order() -> None:
assert list_supported_systems() == list(SUPPORTED_SYSTEMS)
def test_every_supported_system_instantiates_cleanly() -> None:
for system_id in SUPPORTED_SYSTEMS:
system = get_system(system_id)
assert system.system_id == system_id
assert system.state_variables, f"{system_id} declares no state variables"
|