diff --git a/edmond/plugins/tests/test_translate.py b/edmond/plugins/tests/test_translate.py index ca682eb..451846b 100644 --- a/edmond/plugins/tests/test_translate.py +++ b/edmond/plugins/tests/test_translate.py @@ -15,20 +15,17 @@ class TestTranslatePlugin(unittest.TestCase): } # No params. - result = plugin.parse_words(["test"]) + result = plugin.parse_words("test".split()) self.assertEqual(result, ("autodetect", "en", "test")) - # Source param. - result = plugin.parse_words(["!from:fr", "test"]) - self.assertEqual(result, ("fr", "en", "test")) - # Destination param. - result = plugin.parse_words(["!to:fr", "test"]) - self.assertEqual(result, ("autodetect", "fr", "test")) - # Both source and dest params. - result = plugin.parse_words(["!from:it", "!to:fr", "test"]) + # Source param (alone, so wrong). + result = plugin.parse_words("from fr test".split()) + self.assertEqual(result, ("autodetect", "en", "from fr test")) + # Destination param (alone, so wrong). + result = plugin.parse_words("to fr test".split()) + self.assertEqual(result, ("autodetect", "en", "to fr test")) + # Both source and dest params, OK. + result = plugin.parse_words("from it to fr test".split()) self.assertEqual(result, ("it", "fr", "test")) # Badly placed param. - result = plugin.parse_words(["!from:it", "test", "!to:fr"]) - self.assertEqual(result, ("it", "en", "test !to:fr")) - # Unknown param. - result = plugin.parse_words(["!zzz", "test"]) - self.assertEqual(result, ("autodetect", "en", "test")) + result = plugin.parse_words("from it test to fr".split()) + self.assertEqual(result, ("autodetect", "en", "from it test to fr"))