Пример #1
0
def test_porter_type(jf):
    assert jf.porter_stem(u'abc') == 'abc'
    with pytest.raises(TypeError) as exc:
        jf.porter_stem(b'abc')
    assert 'expected' in str(exc.value)
Пример #2
0
def test_porter_stem(jf):
    with open('testdata/porter.csv', **open_kwargs) as f:
        reader = csv.reader(f)
        for (a, b) in reader:
            assert jf.porter_stem(a) == b
Пример #3
0
def test_porter_type(jf):
    assert jf.porter_stem(u'abc') == 'abc'
    with pytest.raises(TypeError) as exc:
        jf.porter_stem(b'abc')
    assert 'expected' in str(exc.value)
Пример #4
0
def test_porter_stem(jf):
    with open('testdata/porter.csv', **open_kwargs) as f:
        reader = csv.reader(f)
        for (a, b) in reader:
            assert jf.porter_stem(a) == b
Пример #5
0
def test_porter_type(jf):
    assert jf.porter_stem(u"abc") == "abc"
    with pytest.raises(TypeError) as exc:
        jf.porter_stem(b"abc")
    assert "expected" in str(exc.value)