add translate test (test if it work & models are downloaded)

This commit is contained in:
Sébastien Thuret 2022-04-03 20:41:59 +02:00
parent 99c6ceba43
commit 97ff47bc2b
No known key found for this signature in database
GPG key ID: 230B93BBA62CB043

View file

@ -0,0 +1,16 @@
import json
def test_api_detect_language(client):
response = client.post("/translate", data={
"q": "Hello",
"source": "en",
"target": "es",
"format": "text"
})
response_json = json.loads(response.data)
assert "translatedText" in response_json
assert response.status_code == 200