(translator, tmpdir)
| 209 | |
| 210 | |
| 211 | def 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 |
nothing calls this directly
no test coverage detected