import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from mcp_server.session import build_session_snapshot # noqa: E402
def test_build_session_snapshot_contains_glossary_and_datasets():
snapshot = build_session_snapshot()
assert "glossary" in snapshot
assert "datasets" in snapshot
assert any(entry["key"] == "mci" for entry in snapshot["glossary"])
dataset_keys = {entry["key"] for entry in snapshot["datasets"]}
assert "all_mito_complex_I_inhibitors.txt" in dataset_keys
assert "instructions" in snapshot and len(snapshot["instructions"]) >= 1
def test_build_session_snapshot_includes_inhibitor_summary():
snapshot = build_session_snapshot()
summary = snapshot["inhibitors_summary"]
assert "total" in summary or "error" in summary