20 lines
		
	
	
		
			361 B
		
	
	
	
		
			Python
		
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			361 B
		
	
	
	
		
			Python
		
	
	
import pickle
 | 
						|
 | 
						|
import stix2
 | 
						|
 | 
						|
from .constants import IDENTITY_ID
 | 
						|
 | 
						|
 | 
						|
def test_pickling():
 | 
						|
    """
 | 
						|
    Ensure a pickle/unpickle cycle works okay.
 | 
						|
    """
 | 
						|
    identity = stix2.v20.Identity(
 | 
						|
        id=IDENTITY_ID,
 | 
						|
        name="alice",
 | 
						|
        description="this is a pickle test",
 | 
						|
        identity_class="individual",
 | 
						|
    )
 | 
						|
 | 
						|
    pickle.loads(pickle.dumps(identity))
 |