Skip to content

Commit

Permalink
Change words used in system test. (#7987)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 authored May 15, 2019
1 parent e7de2c9 commit 271c29c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/google-cloud-translate/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,17 @@ def test_detect_language(self):
self.assertEqual(detections[2]["language"], "fr")

def test_translate(self):
values = ["hvala ti", "dankon", "Me llamo Jeff", "My name is Jeff"]
values = ["petnaest", "dek kvin", "Me llamo Jeff", "My name is Jeff"]
translations = Config.CLIENT.translate(
values, target_language="de", model="nmt"
)
self.assertEqual(len(values), len(translations))

self.assertEqual(translations[0]["detectedSourceLanguage"].lower(), "hr")
self.assertEqual(translations[0]["translatedText"].lower(), "danke")
self.assertEqual(translations[0]["translatedText"].lower(), u"fünfzehn")

self.assertEqual(translations[1]["detectedSourceLanguage"], "eo")
# For some reason this is translated as both "dank" and "danke"
# in a seemingly non-deterministic way.
self.assertIn(translations[1]["translatedText"].lower(), ("dank", "danke"))
self.assertEqual(translations[1]["translatedText"].lower(), u"fünfzehn")

self.assertEqual(translations[2]["detectedSourceLanguage"], "es")
self.assertEqual(translations[2]["translatedText"].lower(), u"ich heiße jeff")
Expand Down

0 comments on commit 271c29c

Please sign in to comment.