2022-12-24 20:20:37 +00:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from api import translate
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
"q,trans,source,target",
|
2022-12-24 22:57:57 +00:00
|
|
|
[
|
|
|
|
("hi there\n", "hola.\n", "en", "es"),
|
|
|
|
("привет", "hi", "auto", "en")
|
|
|
|
]
|
2022-12-24 20:20:37 +00:00
|
|
|
)
|
|
|
|
def test_translate(q, trans, source, target):
|
|
|
|
assert translate(q, source, target) == trans
|