Spaces:
Sleeping
Sleeping
File size: 1,022 Bytes
d903cfe |
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 |
"""
Unit tests for the index.py file
"""
from fastapi.testclient import TestClient
from index import app
client = TestClient(app)
def test_read_root():
response = client.get("/")
assert response.status_code == 200
assert response.json() == {"Hello": "World"}
def test_post_github_access_token_route():
response = client.post("/github/access_token", json={"token": "test_token", "user_email": "test_email"})
assert response.status_code == 200
def test_post_github_repo_route():
response = client.post("/github/repo", json={"repo_name": "test_repo", "user_email": "test_email"})
assert response.status_code == 200
def test_index_github_repo_route():
response = client.post("/github/index", json={"repo_name": "test_repo", "user_email": "test_email"})
assert response.status_code == 200
def test_query_github_repo_route():
response = client.get("/github/query", json={"repo_name": "test_repo", "query": "test_query"})
assert response.status_code == 200
|