Spaces:
Runtime error
Runtime error
Download dev-agent/tests/test_agent_schema.py from BeastGokul/MVP: direct link, hf CLI and curl.
- Browser
- Download file 828 Bytes
-
https://huggingface.co/spaces/BeastGokul/MVP/resolve/main/dev-agent/tests/test_agent_schema.py
- Command line
-
hf download hf://spaces/BeastGokul/MVP/dev-agent/tests/test_agent_schema.py
-
curl -L -o test_agent_schema.py https://huggingface.co/spaces/BeastGokul/MVP/resolve/main/dev-agent/tests/test_agent_schema.py
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 | |