24 lines
763 B
Python
24 lines
763 B
Python
"""Regression: Analysis registry exposes the expected Analyses."""
|
|
|
|
from api.analyses.registry import REGISTRY, catalog, get
|
|
|
|
|
|
def test_registry_has_expected_analyses():
|
|
assert set(REGISTRY) >= {"direct_answer", "compare_periods", "drill_down"}
|
|
|
|
|
|
def test_registry_get_returns_instance_or_none():
|
|
a = get("direct_answer")
|
|
assert a is not None
|
|
assert a.name == "direct_answer"
|
|
assert get("does_not_exist") is None
|
|
|
|
|
|
def test_catalog_shape_for_planner():
|
|
cat = catalog()
|
|
names = {entry["name"] for entry in cat}
|
|
assert names >= {"direct_answer", "compare_periods", "drill_down"}
|
|
for entry in cat:
|
|
assert isinstance(entry["description"], str) and entry["description"]
|
|
assert isinstance(entry["args_schema"], dict)
|