* Unhack serialization api tests

This commit is contained in:
Matthew Honnibal 2015-07-26 16:23:41 +02:00
parent c4f20847da
commit 847c08e411

View File

@ -5,7 +5,8 @@ from spacy.tokens import Doc
import pytest
def mest_getitem(EN):
@pytest.mark.models
def test_getitem(EN):
tokens = EN(u'Give it back! He pleaded.')
assert tokens[0].orth_ == 'Give'
assert tokens[-1].orth_ == '.'
@ -13,7 +14,8 @@ def mest_getitem(EN):
tokens[len(tokens)]
def mest_serialize(EN):
@pytest.mark.models
def test_serialize(EN):
tokens = EN(u'Give it back! He pleaded.')
packed = tokens.to_bytes()
new_tokens = Doc(EN.vocab).from_bytes(packed)
@ -22,6 +24,7 @@ def mest_serialize(EN):
assert [t.orth for t in tokens] == [t.orth for t in new_tokens]
@pytest.mark.models
def test_serialize_whitespace(EN):
tokens = EN(u' Give it back! He pleaded. ')
packed = tokens.to_bytes()