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