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

Function test_invalid_document

tests/test_translate_document.py:211–224  ·  view source on GitHub ↗
(translator, tmpdir)

Source from the content-addressed store, hash-verified

209
210
211def test_invalid_document(translator, tmpdir):
212 tmpdir = pathlib.Path(tmpdir)
213 output_dir = tmpdir / "output"
214 output_dir.mkdir()
215 input_document = tmpdir / "document.invalid"
216 input_document.write_text(example_text["EN"])
217 output_document = output_dir / "document.invalid"
218
219 with pytest.raises(
220 deepl.DeepLException, match="(Invalid file)|(file extension)"
221 ):
222 translator.translate_document_from_filepath(
223 input_document, output_path=output_document, **default_lang_args
224 )
225
226
227@needs_mock_server

Callers

nothing calls this directly

Tested by

no test coverage detected