-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_main.py
More file actions
26 lines (20 loc) · 750 Bytes
/
test_main.py
File metadata and controls
26 lines (20 loc) · 750 Bytes
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
from fastapi.testclient import TestClient
from fastapi import APIRouter
router = APIRouter()
client = TestClient(router)
def test_get_text_from_image():
response = client.get("/pic_to_text")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
def test_transcribe():
response = client.get("/transcribe")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
def test_get_answer_from_gpt():
response = client.get("/answer")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
def test_text_to_speech():
response = client.get("/text-to-speech")
assert response.status_code == 200
assert response.json() == {"status": "ok"}