diff --git a/app/test/test_langid.py b/app/test/test_langid.py index 395f2031..47f15a05 100644 --- a/app/test/test_langid.py +++ b/app/test/test_langid.py @@ -120,6 +120,19 @@ def test_langid_api_get_without_text(self): self.assertEqual('application/json', response.content_type) self.assertEqual(200, response.status_code) + def test_null_prediction_cld(self): + with patch('cld3.get_language', ) as mock_cld3_get_language: + mock_cld3_get_language.return_value = None + expected = { + 'result': { + 'language': None, + 'confidence': None + }, + 'raw': None, + 'model': 'CLD3', + } + self.assertEqual(Cld3LangidProvider.langid(text), {}) + def test_langid_api_post(self): response = self.client.post( '/text/langid/',