1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-12-18 08:27:03 +02:00
LibreTranslate/tests/test_api/test_api_translate.py

17 lines
329 B
Python
Raw Normal View History

import json
2022-04-04 08:26:58 +02:00
def test_api_translate(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