Commit fa088a20 authored by Michal Čihař's avatar Michal Čihař

Fix testcase for machine translation

parent e136e19f
......@@ -43,36 +43,36 @@ class MachineTranslationTest(TestCase):
def test_translate(self):
machine_translation = DummyTranslation()
self.assertEqual(
machine_translation.translate('cs', 'Hello'),
machine_translation.translate('cs', 'Hello', None),
[]
)
self.assertEqual(
len(machine_translation.translate('cs', 'Hello, world!')),
len(machine_translation.translate('cs', 'Hello, world!', None)),
2
)
def test_glosbe(self):
machine = GlosbeTranslation()
self.assertIsInstance(machine.translate('cs', 'world'), list)
self.assertIsInstance(machine.translate('cs', 'world', None), list)
def test_mymemory(self):
machine = MyMemoryTranslation()
self.assertIsInstance(machine.translate('cs', 'world'), list)
self.assertIsInstance(machine.translate('cs', 'world', None), list)
def test_opentran(self):
machine = OpenTranTranslation()
self.assertIsInstance(machine.translate('cs', 'world'), list)
self.assertIsInstance(machine.translate('cs', 'world', None), list)
def test_apertium(self):
machine = ApertiumTranslation()
self.assertIsInstance(machine.translate('es', 'world'), list)
self.assertIsInstance(machine.translate('es', 'world', None), list)
@unittest.skipUnless(microsoft_translation_supported(),
'missing credentials')
def test_microsoft(self):
machine = MicrosoftTranslation()
self.assertIsInstance(machine.translate('cs', 'world'), list)
self.assertIsInstance(machine.translate('cs', 'world', None), list)
def test_google(self):
machine = GoogleTranslation()
self.assertIsInstance(machine.translate('cs', 'world'), list)
self.assertIsInstance(machine.translate('cs', 'world', None), list)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment