=
commited on
Commit
·
5a13ae6
1
Parent(s):
b1c7fbf
fixed test fixtures
Browse files
deep_translator/linguee.py
CHANGED
@@ -87,3 +87,6 @@ class LingueeTranslator(BaseTranslator):
|
|
87 |
return translated_words
|
88 |
|
89 |
|
|
|
|
|
|
|
|
87 |
return translated_words
|
88 |
|
89 |
|
90 |
+
if __name__ == '__main__':
|
91 |
+
l = LingueeTranslator("en", "fr").translate("good")
|
92 |
+
print("translated: ", l)
|
deep_translator/tests/test_linguee.py
CHANGED
@@ -20,10 +20,10 @@ def test_content(linguee):
|
|
20 |
|
21 |
def test_inputs():
|
22 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
23 |
-
|
24 |
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
-
|
27 |
|
28 |
|
29 |
def test_payload(linguee):
|
|
|
20 |
|
21 |
def test_inputs():
|
22 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
23 |
+
LingueeTranslator(source="", target="")
|
24 |
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
+
LingueeTranslator(source="auto", target="nothing")
|
27 |
|
28 |
|
29 |
def test_payload(linguee):
|
deep_translator/tests/test_mymemory.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
"""Tests for `deep_translator` package."""
|
4 |
|
5 |
import pytest
|
6 |
-
from deep_translator import exceptions,
|
7 |
|
8 |
|
9 |
@pytest.fixture
|
@@ -20,10 +20,10 @@ def test_content(mymemory):
|
|
20 |
|
21 |
def test_inputs():
|
22 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
23 |
-
|
24 |
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
-
|
27 |
|
28 |
|
29 |
def test_payload(mymemory):
|
|
|
3 |
"""Tests for `deep_translator` package."""
|
4 |
|
5 |
import pytest
|
6 |
+
from deep_translator import exceptions, MyMemoryTranslator
|
7 |
|
8 |
|
9 |
@pytest.fixture
|
|
|
20 |
|
21 |
def test_inputs():
|
22 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
23 |
+
MyMemoryTranslator(source="", target="")
|
24 |
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
+
MyMemoryTranslator(source="auto", target="nothing")
|
27 |
|
28 |
|
29 |
def test_payload(mymemory):
|
deep_translator/tests/test_pons.py
CHANGED
@@ -20,10 +20,10 @@ def test_content(pons):
|
|
20 |
|
21 |
def test_inputs():
|
22 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
23 |
-
|
24 |
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
-
|
27 |
|
28 |
|
29 |
def test_payload(pons):
|
|
|
20 |
|
21 |
def test_inputs():
|
22 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
23 |
+
PonsTranslator(source="", target="")
|
24 |
|
25 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
26 |
+
PonsTranslator(source="auto", target="nothing")
|
27 |
|
28 |
|
29 |
def test_payload(pons):
|