Files
agentbox/tests/test_api.py
T
Yash Shah 20ebd1a69d feat(init): add agentbox v0.1 foundation
Self-hosted agent code execution API with FastAPI, subprocess sandbox,
Python SDK client, Docker Compose service, and unit tests.
2026-08-19 00:32:53 +05:30

22 lines
518 B
Python

"""Tests for agentbox API."""
from fastapi.testclient import TestClient
from agentbox.api.app import app
client = TestClient(app)
def test_health() -> None:
resp = client.get("/health")
assert resp.status_code == 200
assert resp.json()["status"] == "ok"
def test_run_python() -> None:
resp = client.post("/v1/run", json={"code": "print('hello agentbox')"})
assert resp.status_code == 200
body = resp.json()
assert "hello agentbox" in body["stdout"]
assert body["exit_code"] == 0