mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-01 17:39:39 +02:00
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:
commit
74cc8a4685
1216 changed files with 116347 additions and 0 deletions
38
tests/unit/test_api.py
Normal file
38
tests/unit/test_api.py
Normal 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')
|
||||
Loading…
Add table
Add a link
Reference in a new issue