=
commited on
Commit
·
5c26975
1
Parent(s):
65c7dd4
added tests
Browse files
tests/test_deep_translator.py
CHANGED
@@ -5,13 +5,15 @@
|
|
5 |
import pytest
|
6 |
from deep_translator import exceptions, GoogleTranslator
|
7 |
|
|
|
8 |
@pytest.fixture
|
9 |
def response():
|
10 |
"""Sample pytest fixture.
|
11 |
|
12 |
See more at: http://doc.pytest.org/en/latest/fixture.html
|
13 |
"""
|
14 |
-
|
|
|
15 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
16 |
GoogleTranslator(source="", target="")
|
17 |
|
|
|
5 |
import pytest
|
6 |
from deep_translator import exceptions, GoogleTranslator
|
7 |
|
8 |
+
|
9 |
@pytest.fixture
|
10 |
def response():
|
11 |
"""Sample pytest fixture.
|
12 |
|
13 |
See more at: http://doc.pytest.org/en/latest/fixture.html
|
14 |
"""
|
15 |
+
translator = GoogleTranslator(target='en')
|
16 |
+
assert translator.translate(payload='좋은') == "good"
|
17 |
with pytest.raises(exceptions.LanguageNotSupportedException):
|
18 |
GoogleTranslator(source="", target="")
|
19 |
|