MVP / dev-agent /tests /test_agent_schema.py
github-actions[bot]
Deploy application
595d60e
Raw History Blame Contribute Delete
828 Bytes
from app.schemas.agent_spec import AgentSpec, ConnectionConfig, TriggerConfig, ConnectionType, TriggerType, ModeType
def test_valid_spec():
spec = AgentSpec(
name="Test Agent",
connection=ConnectionConfig(type=ConnectionType.API, config={"base_url": "http://example.com"}),
trigger=TriggerConfig(type=TriggerType.MANUAL, config={}),
mode=ModeType.WORKFLOW
)
assert spec.name == "Test Agent"
def test_validation_service():
from app.services.validation_service import ValidationService
svc = ValidationService()
data = {
"name": "Test",
"connection": {"type": "api", "config": {}},
"trigger": {"type": "manual", "config": {}},
"mode": "workflow"
}
result = svc.validate(data)
assert result.valid == False # missing base_url