Add Doc slicing tests

This commit is contained in:
Yubing (Tom) Dong 2015-10-06 00:51:25 -07:00
parent e4ba8a4b5a
commit 73566899bf
1 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,15 @@ def test_getitem(EN):
with pytest.raises(IndexError): with pytest.raises(IndexError):
tokens[len(tokens)] tokens[len(tokens)]
span = tokens[1:1]
assert not '/'.join(token.orth_ for token in span)
span = tokens[1:4]
assert '/'.join(token.orth_ for token in span) == 'it/back/!'
with pytest.raises(ValueError):
tokens[1:4:2]
with pytest.raises(ValueError):
tokens[1:4:-1]
@pytest.mark.models @pytest.mark.models
def test_serialize(EN): def test_serialize(EN):