pageparse.ai / tests /test_translation.py
Varun2007's picture
initial clean deployment commit with compilers
8c3e275
Raw
History Blame Contribute Delete
566 Bytes
from pageparse.translation import translate_text, INDIAN_LANGUAGES
def test_indian_languages_include_english():
assert "English" in INDIAN_LANGUAGES
def test_translate_text_empty():
assert translate_text("", "Hindi") == ""
assert translate_text(" ", "Hindi") == " "
def test_translate_text_non_ascii_returns_as_is():
text = "परीक्षण"
assert translate_text(text, "English") == text
def test_translate_text_english_unchanged():
text = "Hello world"
result = translate_text(text, "English")
assert result == text