physix-live-src / tests /test_registry.py
Pratyush-01's picture
Initial physix-live source for HF Jobs training
b99b9ee verified
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"