Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_detect_language_en(self):
texts = [
'this is an english text',
'this is also something written in engilsh',
'and finally something else to make sure that the language is detected'
]
language = TextCleaner.detect_language(texts)
assert language == 'en'
def test_detect_language_es(self):
texts = [
'esto es un texto en español',
'esto también está escrito en español',
'y finalmente alguna cosa más para asegurar que el idioma es detectado'
]
language = TextCleaner.detect_language(texts)
assert language == 'es'