File size: 582 Bytes
58973c7
 
 
 
 
 
 
ba938cd
58973c7
 
 
 
 
 
 
ba938cd
0f046d0
58973c7
 
 
1ef298a
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from fastapi.testclient import TestClient
from backend.app.main import app

client = TestClient(app)

def test_crawl_endpoint():
    response = client.post(
        "/api/crawl/",
        json={"url": "https://example.com"}
    )
    assert response.status_code == 200
    assert response.json() == {"status": "received"}

def test_problems_endpoint():
    response = client.post(
        "/api/problems/",
        json={"user_query": "RAG"}
    )
    assert response.status_code == 200
    assert "Problems" in response.json()
    assert len(response.json()["Problems"]) == 5