Commit 2b3d6d55 authored by Michal Čihař's avatar Michal Čihař

Test all current translation backends

parent 43fd711f
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
from django.test import TestCase from django.test import TestCase
from trans.machine.dummy import DummyTranslation from trans.machine.dummy import DummyTranslation
from trans.machine.glosbe import GlosbeTranslation
from trans.machine.mymemory import MyMemoryTranslation
from trans.machine.opentran import OpenTranTranslation
class MachineTranslationTest(TestCase): class MachineTranslationTest(TestCase):
...@@ -41,3 +44,15 @@ class MachineTranslationTest(TestCase): ...@@ -41,3 +44,15 @@ class MachineTranslationTest(TestCase):
machine_translation.translate('cs', 'Hello, world!'), machine_translation.translate('cs', 'Hello, world!'),
[] []
) )
def test_glosbe(self):
machine = GlosbeTranslation()
self.assertGreater(len(machine.translate('cs', 'world')), 0)
def test_mymemory(self):
machine = MyMemoryTranslation()
self.assertGreater(len(machine.translate('cs', 'world')), 0)
def test_opentran(self):
machine = OpenTranTranslation()
self.assertGreater(len(machine.translate('cs', 'world')), 0)
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