Squashed 'ai-context/trustgraph-templates/' content from commit 42a5fd1b

git-subtree-dir: ai-context/trustgraph-templates
git-subtree-split: 42a5fd1b678f32be378062e30451e2052ccb95dd
This commit is contained in:
elpresidank 2026-04-05 21:09:49 -05:00
commit 74cc8a4685
1216 changed files with 116347 additions and 0 deletions

38
tests/unit/test_api.py Normal file
View file

@ -0,0 +1,38 @@
"""
Unit tests for Index class.
"""
import pytest
from trustgraph_configurator import Index
@pytest.mark.unit
class TestAPI:
"""Tests for the Index class."""
def test_get_templates_returns_list(self):
"""Test that get_templates returns a list."""
templates = Index.get_templates()
assert isinstance(templates, list)
assert len(templates) > 0
def test_templates_have_required_fields(self):
"""Test that templates have name and version fields."""
templates = Index.get_templates()
for template in templates:
assert hasattr(template, 'name')
assert hasattr(template, 'version')
def test_get_latest_returns_template(self):
"""Test that get_latest returns a template."""
latest = Index.get_latest()
assert latest is not None
assert hasattr(latest, 'name')
assert hasattr(latest, 'version')
def test_get_latest_stable_returns_template(self):
"""Test that get_latest_stable returns a template."""
latest_stable = Index.get_latest_stable()
assert latest_stable is not None
assert hasattr(latest_stable, 'name')
assert hasattr(latest_stable, 'version')