workspace / tests /test_experiments /test_loader.py
AntonioJun's picture
Replace tests with local workspace contents
e8055cf verified
Raw
History Blame Contribute Delete
662 Bytes
import pytest
from experiments import loader
def test_lists_human_readable_hypotheses():
names = loader.list_hypotheses()
assert "Compute Gravity Before Building Object Instances" in names
assert all(not name.endswith(".py") for name in names)
def test_loads_filename_with_spaces():
module = loader.load_hypothesis("Compute Gravity Before Building Object Instances")
assert callable(module.build_spatial_code)
assert callable(module.dump_spatial_code)
def test_missing_hypothesis_has_clear_error():
with pytest.raises(FileNotFoundError, match="hypothesis does not exist"):
loader.load_hypothesis("This Does Not Exist")