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

Function test_translate_document_with_retry

tests/test_translate_document.py:37–54  ·  view source on GitHub ↗
(
    translator,
    server,
    example_document_path,
    example_document_translation,
    output_document_path,
    monkeypatch,
)

Source from the content-addressed store, hash-verified

35
36@needs_mock_server
37def 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

Callers

nothing calls this directly

Calls 2

no_responseMethod · 0.80

Tested by

no test coverage detected