Initial commit: VoIdeaAI - voice-first AI idea assistant
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
"""Tests for SecurityAgent."""
|
||||
|
||||
import pytest
|
||||
|
||||
from app.agents.security_agent import SecurityAgent
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def security_agent():
|
||||
return SecurityAgent()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_security_agent_initialization(security_agent):
|
||||
"""Test SecurityAgent initializes correctly."""
|
||||
assert security_agent.name == "security_agent"
|
||||
assert security_agent.version == "1.0.0"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_security_agent_health_check(security_agent):
|
||||
"""Test SecurityAgent health check."""
|
||||
result = await security_agent.health_check()
|
||||
assert isinstance(result, bool)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_security_agent_run(security_agent):
|
||||
"""Test SecurityAgent run."""
|
||||
context = {"action": "scan", "paths": ["app"]}
|
||||
result = await security_agent.run(context)
|
||||
assert hasattr(result, "success")
|
||||
assert hasattr(result, "message")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_security_agent_full_check(security_agent):
|
||||
"""Test SecurityAgent full security check."""
|
||||
result = await security_agent.run({"action": "full", "paths": ["app"]})
|
||||
assert hasattr(result, "success")
|
||||
assert hasattr(result, "data")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_security_agent_dependencies(security_agent):
|
||||
"""Test SecurityAgent dependency check."""
|
||||
result = await security_agent._check_dependencies()
|
||||
assert hasattr(result, "success")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_security_agent_compliance(security_agent):
|
||||
"""Test SecurityAgent 152-FZ compliance check."""
|
||||
result = await security_agent._check_152_fz_compliance()
|
||||
assert hasattr(result, "success")
|
||||
assert "warnings" in result.data
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_security_agent_metrics(security_agent):
|
||||
"""Test SecurityAgent metrics."""
|
||||
metrics = await security_agent.get_metrics()
|
||||
assert "agent_id" in metrics
|
||||
assert "status" in metrics
|
||||
Reference in New Issue
Block a user