(
deepl_client,
multilingual_glossary_manager,
example_document_path,
output_document_path,
)
| 447 | |
| 448 | |
| 449 | def test_glossary_translate_document( |
| 450 | deepl_client, |
| 451 | multilingual_glossary_manager, |
| 452 | example_document_path, |
| 453 | output_document_path, |
| 454 | ): |
| 455 | input_text = "artist\nprize" |
| 456 | expected_output_text = "Maler\nGewinn" |
| 457 | example_document_path.write_text(input_text) |
| 458 | entries = {"artist": "Maler", "prize": "Gewinn"} |
| 459 | glossary_dict = MultilingualGlossaryDictionaryEntries("EN", "DE", entries) |
| 460 | with multilingual_glossary_manager([glossary_dict]) as glossary: |
| 461 | deepl_client.translate_document_from_filepath( |
| 462 | example_document_path, |
| 463 | output_path=output_document_path, |
| 464 | source_lang="EN", |
| 465 | target_lang="DE", |
| 466 | glossary=glossary, |
| 467 | ) |
| 468 | assert expected_output_text == output_document_path.read_text() |
| 469 | |
| 470 | |
| 471 | def test_glossary_translate_text_invalid( |
nothing calls this directly
no test coverage detected