mirror of
https://github.com/yashshah9/agentbox.git
synced 2026-11-19 02:16:20 +00:00
Self-hosted agent code execution API with FastAPI, subprocess sandbox, Python SDK client, Docker Compose service, and unit tests.
22 lines
518 B
Python
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
|