mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-04 13:40:34 +03:00
18 lines
370 B
Python
18 lines
370 B
Python
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
|
|
|