(
translator,
server,
example_document_path,
example_document_translation,
output_document_path,
monkeypatch,
)
| 35 | |
| 36 | @needs_mock_server |
| 37 | def test_translate_document_with_retry( |
| 38 | translator, |
| 39 | server, |
| 40 | example_document_path, |
| 41 | example_document_translation, |
| 42 | output_document_path, |
| 43 | monkeypatch, |
| 44 | ): |
| 45 | server.no_response(1) |
| 46 | # Lower the timeout for this test, and restore after test |
| 47 | monkeypatch.setattr(deepl.http_client, "min_connection_timeout", 1.0) |
| 48 | |
| 49 | translator.translate_document_from_filepath( |
| 50 | example_document_path, |
| 51 | output_path=output_document_path, |
| 52 | **default_lang_args, |
| 53 | ) |
| 54 | assert example_document_translation == output_document_path.read_text() |
| 55 | |
| 56 | |
| 57 | @needs_mock_server |
nothing calls this directly
no test coverage detected