Initial commit: VoIdeaAI - voice-first AI idea assistant
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
"""Tests for SpecAgent."""
|
||||
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
from app.agents.spec_agent import SpecAgent
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def spec_agent():
|
||||
return SpecAgent()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_spec_agent_initialization(spec_agent):
|
||||
"""Test SpecAgent initializes correctly."""
|
||||
assert spec_agent.name == "spec_agent"
|
||||
assert spec_agent.version == "1.0.0"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_spec_agent_health_check(spec_agent):
|
||||
"""Test SpecAgent health check."""
|
||||
result = await spec_agent.health_check()
|
||||
assert isinstance(result, bool)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_spec_agent_check_version(spec_agent):
|
||||
"""Test SpecAgent version check."""
|
||||
result = await spec_agent.run({"action": "check"})
|
||||
assert result.success
|
||||
assert "current_version" in result.data
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_spec_agent_bump_version(spec_agent):
|
||||
"""Test SpecAgent version bump."""
|
||||
context = {
|
||||
"action": "version_bump",
|
||||
"version_type": "patch",
|
||||
}
|
||||
result = await spec_agent.run(context)
|
||||
assert result.success
|
||||
assert "new_version" in result.data
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_spec_agent_parse_commit_type(spec_agent):
|
||||
"""Test commit type parsing."""
|
||||
assert spec_agent._parse_commit_type("feat: add feature") == "feat"
|
||||
assert spec_agent._parse_commit_type("fix: bug fix") == "fix"
|
||||
assert spec_agent._parse_commit_type("docs: update docs") == "docs"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_spec_agent_parse_commit_message(spec_agent):
|
||||
"""Test commit message parsing."""
|
||||
assert "add feature" in spec_agent._parse_commit_message("feat: add feature")
|
||||
assert "bug fix" in spec_agent._parse_commit_message("fix: bug fix")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_spec_agent_metrics(spec_agent):
|
||||
"""Test SpecAgent metrics."""
|
||||
metrics = await spec_agent.get_metrics()
|
||||
assert "agent_id" in metrics
|
||||
assert "version" in metrics
|
||||
assert "status" in metrics
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_spec_agent_unknown_action(spec_agent):
|
||||
"""Test SpecAgent with unknown action."""
|
||||
result = await spec_agent.run({"action": "unknown"})
|
||||
assert result.success
|
||||
Reference in New Issue
Block a user