1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-11-05 07:20:13 +01:00

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