MCPcopy Index your code
hub / github.com/DeepL/deepl-python / test_example_translation

Function test_example_translation

tests/test_general.py:42–54  ·  view source on GitHub ↗

Tests translations of pre-prepared example texts to ensure translation is working. The texts are translations of "proton beam".

(lang, translator)

Source from the content-addressed store, hash-verified

40 [k for k in example_text.keys()],
41)
42def test_example_translation(lang, translator):
43 """Tests translations of pre-prepared example texts to ensure translation
44 is working.
45
46 The texts are translations of "proton beam"."""
47
48 input_text = example_text[lang]
49 source_lang = deepl.Language.remove_regional_variant(lang)
50 result = translator.translate_text(
51 input_text, source_lang=source_lang, target_lang="EN-US"
52 )
53 assert "proton" in result.text.lower()
54 assert result.billed_characters == len(input_text)
55
56
57@needs_real_server

Callers

nothing calls this directly

Calls 2

translate_textMethod · 0.80

Tested by

no test coverage detected