Unit tests for pickle serialization.