feat(agent-office): GET /api/agent-office/nodes 엔드포인트
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LV86jBozkNhSFXJA412fq
This commit is contained in:
18
agent-office/tests/test_nodes_endpoint.py
Normal file
18
agent-office/tests/test_nodes_endpoint.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# agent-office/tests/test_nodes_endpoint.py
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
@pytest.fixture
|
||||
def client(monkeypatch):
|
||||
from app import main
|
||||
async def fake_collect(redis=None):
|
||||
return {"redis_ok": True, "paused": False, "paused_reason": None,
|
||||
"generated_at": "2026-06-29T00:00:00Z", "workers": [], "links": []}
|
||||
monkeypatch.setattr("app.node_monitor.collect_status", fake_collect)
|
||||
return TestClient(main.app)
|
||||
|
||||
def test_nodes_endpoint_returns_contract(client):
|
||||
resp = client.get("/api/agent-office/nodes")
|
||||
assert resp.status_code == 200
|
||||
body = resp.json()
|
||||
assert set(["redis_ok","paused","workers","links"]).issubset(body)
|
||||
Reference in New Issue
Block a user