Пример #1
0
def test1():
    t = deepl.DeepLCLI(langs=('en', 'ja'))
    assert t.translate('hello') == 'こんにちわ'
Пример #2
0
def test7():
    t = deepl.DeepLCLI(langs=('', 'ja'))
    assert t.translate('test') == 'しけん'
Пример #3
0
def test6():
    with pytest.raises(deepl.DeepLCLIArgCheckingError):
        deepl.DeepLCLI(langs=('enn', 'ja'))
Пример #4
0
def test4():
    t = deepl.DeepLCLI()
    with pytest.raises(AttributeError):
        t.translate('test')
Пример #5
0
def test3():
    t = deepl.DeepLCLI(langs=('en', 'ja'))
    with pytest.raises(deepl.DeepLCLIArgCheckingError):
        t.chk_cmdargs()
Пример #6
0
def test2():
    t = deepl.DeepLCLI(langs=('en', 'ja'))
    with pytest.raises(deepl.DeepLCLIArgCheckingError):
        t.translate('\n')