File size: 1,390 Bytes
c04c800
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import pytest


@pytest.mark.asyncio
async def test_health_check(client):
    response = await client.get("/health")
    assert response.status_code == 200
    data = response.json()
    assert data["status"] == "healthy"


@pytest.mark.asyncio
async def test_list_agents(client):
    response = await client.get("/agents/")
    assert response.status_code == 200
    data = response.json()
    assert len(data) == 30
    assert data[0]["id"]
    assert data[0]["name"]


@pytest.mark.asyncio
async def test_get_agent(client):
    response = await client.get("/agents/web_research")
    assert response.status_code == 200
    data = response.json()
    assert data["id"] == "web_research"
    assert "Web Research" in data["name"]


@pytest.mark.asyncio
async def test_get_agent_not_found(client):
    response = await client.get("/agents/nonexistent")
    assert response.status_code == 404


@pytest.mark.asyncio
async def test_agent_appraisal(client):
    response = await client.get("/agents/web_research/appraisal")
    assert response.status_code == 200
    data = response.json()
    assert "valuation" in data


@pytest.mark.asyncio
async def test_portfolio_appraisal(client):
    response = await client.get("/agents/portfolio/appraisal")
    assert response.status_code == 200
    data = response.json()
    assert "total_valuation" in data
    assert "average_valuation" in data