Esempio n. 1
0
    class TestFreeTranslation:
        def setup_class(self):
            self.backend = FreeTranslationBackend()

        def test_init(self):
            api_key = os.environ.get('FREETRANSLATION_KEY')

            assert self.backend.activate({'key': api_key, 'active': True})
            assert len(self.backend.language_pairs) != 0

        def test_translate(self):
            pair = self.backend.language_pairs[0]

            trans = self.backend.translate('hello', pair[0], pair[1])
            assert trans is not None
Esempio n. 2
0
    class TestFreeTranslation:
        def setup_class(self):
            self.backend = FreeTranslationBackend()

        def test_init(self):
            api_key = os.environ.get("FREETRANSLATION_KEY")

            assert self.backend.activate({"key": api_key, "active": True})
            assert len(self.backend.language_pairs) != 0

        def test_translate(self):
            pair = self.backend.language_pairs[0]

            trans = self.backend.translate("hello", pair[0], pair[1])
            assert trans is not None
Esempio n. 3
0
 def setup_class(self):
     self.backend = FreeTranslationBackend()
Esempio n. 4
0
 def setup_class(self):
     self.backend = FreeTranslationBackend()