File size: 581 Bytes
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(
"/crawl/",
json={"url": "https://example.com"}
)
assert response.status_code == 200
assert response.json() == {"status": "received"}
def test_problems_endpoint():
response = client.post(
"/problems/",
json={"user_query": "test query"}
)
assert response.status_code == 200
assert "Problems" in response.json()
assert len(response.json()["Problems"]) == 5
|