mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +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
|
||
|
|