mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-02-16 17:45:18 +00:00
16 lines
335 B
Python
16 lines
335 B
Python
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
|
|
|