示例#1
0
 def test_machine(self):
     self.add_document()
     machine_translation = WeblateMemory()
     self.assertEqual(
         machine_translation.translate('cs', 'Hello', MockUnit(), None), [
             {
                 'quality': 100,
                 'service': 'Weblate Translation Memory (test)',
                 'source': 'Hello',
                 'text': 'Ahoj'
             },
         ])
示例#2
0
 def test_machine(self):
     self.add_document()
     machine_translation = WeblateMemory()
     self.assertEqual(
         machine_translation.translate('cs', 'Hello', MockUnit(), None),
         [
             {
                 'quality': 100,
                 'service': 'Weblate Translation Memory (test)',
                 'source': 'Hello',
                 'text': 'Ahoj'
             },
         ]
     )
示例#3
0
 def test_machine(self):
     add_document()
     unit = self.get_unit()
     machine_translation = WeblateMemory()
     self.assertEqual(
         machine_translation.translate(unit, search="Hello"),
         [{
             "quality": 100,
             "service": "Weblate Translation Memory",
             "origin": "File: test",
             "source": "Hello",
             "text": "Ahoj",
         }],
     )
示例#4
0
 def test_machine(self):
     add_document()
     machine_translation = WeblateMemory()
     request = HttpRequest()
     request.user = None
     self.assertEqual(
         machine_translation.translate('cs', 'Hello', MockUnit(), request),
         [
             {
                 'quality': 100,
                 'service': 'Weblate Translation Memory (File: test)',
                 'source': 'Hello',
                 'text': 'Ahoj'
             },
         ])
示例#5
0
文件: tests.py 项目: dekoza/weblate
 def test_machine(self):
     add_document()
     machine_translation = WeblateMemory()
     request = HttpRequest()
     request.user = None
     self.assertEqual(
         machine_translation.translate('cs', 'Hello', MockUnit(), request),
         [
             {
                 'quality': 100,
                 'service': 'Weblate Translation Memory (File: test)',
                 'source': 'Hello',
                 'text': 'Ahoj'
             },
         ]
     )