=
commited on
Commit
·
a1efbe8
1
Parent(s):
853b244
completed test suite
Browse files- deep_translator/linguee.py +0 -4
- deep_translator/mymemory.py +0 -4
- deep_translator/pons.py +0 -4
- deep_translator/tests/{test_deep_translator.py → test_google_trans.py} +0 -0
- deep_translator/tests/test_linguee.py +5 -0
- deep_translator/tests/test_mymemory.py +4 -1
- deep_translator/tests/test_pons.py +4 -1
deep_translator/linguee.py
CHANGED
@@ -86,7 +86,3 @@ class LingueeTranslator(BaseTranslator):
|
|
86 |
translated_words.append(self.translate(payload=word))
|
87 |
return translated_words
|
88 |
|
89 |
-
|
90 |
-
if __name__ == '__main__':
|
91 |
-
l = LingueeTranslator("en", "fr").translate("good")
|
92 |
-
print("translated: ", l)
|
|
|
86 |
translated_words.append(self.translate(payload=word))
|
87 |
return translated_words
|
88 |
|
|
|
|
|
|
|
|
deep_translator/mymemory.py
CHANGED
@@ -111,7 +111,3 @@ class MyMemoryTranslator(BaseTranslator):
|
|
111 |
except Exception as e:
|
112 |
raise e
|
113 |
|
114 |
-
|
115 |
-
if __name__ == '__main__':
|
116 |
-
m = MyMemoryTranslator("english", "french").translate("good")
|
117 |
-
print(m)
|
|
|
111 |
except Exception as e:
|
112 |
raise e
|
113 |
|
|
|
|
|
|
|
|
deep_translator/pons.py
CHANGED
@@ -95,7 +95,3 @@ class PonsTranslator(BaseTranslator):
|
|
95 |
translated_words.append(self.translate(payload=word))
|
96 |
return translated_words
|
97 |
|
98 |
-
|
99 |
-
if __name__ == '__main__':
|
100 |
-
l = PonsTranslator("en", "fr").translate("good")
|
101 |
-
print("translated: ", l)
|
|
|
95 |
translated_words.append(self.translate(payload=word))
|
96 |
return translated_words
|
97 |
|
|
|
|
|
|
|
|
deep_translator/tests/{test_deep_translator.py → test_google_trans.py}
RENAMED
File without changes
|
deep_translator/tests/test_linguee.py
CHANGED
@@ -25,6 +25,11 @@ def test_inputs():
|
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
LingueeTranslator(source="auto", target="nothing")
|
27 |
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
def test_payload(linguee):
|
30 |
|
|
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
LingueeTranslator(source="auto", target="nothing")
|
27 |
|
28 |
+
l1 = LingueeTranslator("en", "fr")
|
29 |
+
l2 = LingueeTranslator("english", "french")
|
30 |
+
assert l1._source == l2._source
|
31 |
+
assert l1._target == l2._target
|
32 |
+
|
33 |
|
34 |
def test_payload(linguee):
|
35 |
|
deep_translator/tests/test_mymemory.py
CHANGED
@@ -24,7 +24,10 @@ def test_inputs():
|
|
24 |
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
MyMemoryTranslator(source="auto", target="nothing")
|
27 |
-
|
|
|
|
|
|
|
28 |
|
29 |
def test_payload(mymemory):
|
30 |
|
|
|
24 |
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
MyMemoryTranslator(source="auto", target="nothing")
|
27 |
+
m1 = MyMemoryTranslator("en", "fr")
|
28 |
+
m2 = MyMemoryTranslator("english", "french")
|
29 |
+
assert m1._source == m2._source
|
30 |
+
assert m1._target == m2._target
|
31 |
|
32 |
def test_payload(mymemory):
|
33 |
|
deep_translator/tests/test_pons.py
CHANGED
@@ -24,7 +24,10 @@ def test_inputs():
|
|
24 |
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
PonsTranslator(source="auto", target="nothing")
|
27 |
-
|
|
|
|
|
|
|
28 |
|
29 |
def test_payload(pons):
|
30 |
|
|
|
24 |
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
PonsTranslator(source="auto", target="nothing")
|
27 |
+
l1 = PonsTranslator("en", "fr")
|
28 |
+
l2 = PonsTranslator("english", "french")
|
29 |
+
assert l1._source == l2._source
|
30 |
+
assert l1._target == l2._target
|
31 |
|
32 |
def test_payload(pons):
|
33 |
|