spaCy/spacy/tests/test_pickles.py

18 lines
370 B
Python
Raw Normal View History

2017-03-07 19:15:18 +03:00
from __future__ import unicode_literals
import io
import pickle
from ..strings import StringStore
def test_pickle_string_store():
sstore = StringStore()
hello = sstore['hello']
bye = sstore['bye']
bdata = pickle.dumps(sstore, protocol=-1)
unpickled = pickle.loads(bdata)
assert unpickled['hello'] == hello
assert unpickled['bye'] == bye