()
| 342 | |
| 343 | |
| 344 | def _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 |
no outgoing calls
no test coverage detected