MCPcopy Create free account
hub / github.com/DeepL/deepl-python / _build_test_response

Function _build_test_response

tests/test_general.py:344–367  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

342
343
344def _build_test_response():
345 response = Mock(spec=Response)
346 response.status_code = 200
347 response.text = (
348 '{"translations": [{'
349 '"detected_source_language": "EN", '
350 '"text": "protonstråle", '
351 f'"billed_characters": {len(example_text["EN"])}'
352 "}]}"
353 )
354 response.headers = {
355 "Content-Type": "application/json",
356 "Server": "nginx",
357 "Content-Length": str(len(response.text.encode("utf-8"))),
358 "Connection": "keep-alive",
359 "Access-Control-Allow-Origin": "*",
360 }
361 response.encoding = "utf-8"
362 response.history = None
363 response.raw = None
364 response.is_redirect = False
365 response.stream = False
366 response.url = "https://api.deepl.com/v2/translate"
367 return response

Calls

no outgoing calls

Tested by

no test coverage detected