def check_pickle_roundtrip(source, options, **kwargs):
source = options.constructor(source, **kwargs)<EOL>data = pickle.dumps(source)<EOL>loaded = pickle.loads(data)<EOL>assert_true(isinstance(loaded, options.cls))<EOL>assert_equals(source, loaded)<EOL>return loaded<EOL>
serialize then deserialize a mapping, ensuring the result and initial
objects are equivalent.