2018-07-03 13:00:18 +02:00
|
|
|
import pickle
|
|
|
|
|
|
|
|
import stix2
|
|
|
|
|
2019-01-29 16:52:59 +01:00
|
|
|
from .constants import IDENTITY_ID
|
|
|
|
|
2018-07-03 13:00:18 +02:00
|
|
|
|
|
|
|
def test_pickling():
|
|
|
|
"""
|
|
|
|
Ensure a pickle/unpickle cycle works okay.
|
|
|
|
"""
|
2018-07-03 15:40:51 +02:00
|
|
|
identity = stix2.v21.Identity(
|
2019-01-29 16:52:59 +01:00
|
|
|
id=IDENTITY_ID,
|
2018-07-03 13:00:18 +02:00
|
|
|
name="alice",
|
|
|
|
description="this is a pickle test",
|
2020-07-10 02:13:53 +02:00
|
|
|
identity_class="individual",
|
2018-07-03 13:00:18 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
pickle.loads(pickle.dumps(identity))
|