MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_pickling

Method test_pickling

test/test_objectid.py:111–115  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

109 self.assertEqual(as_utc, oid.generation_time)
110
111 def test_pickling(self):
112 orig = ObjectId()
113 for protocol in [0, 1, 2, -1]:
114 pkl = pickle.dumps(orig, protocol=protocol)
115 self.assertEqual(orig, pickle.loads(pkl))
116
117 def test_pickle_backwards_compatability(self):
118 # This string was generated by pickling an ObjectId in pymongo

Callers

nothing calls this directly

Calls 1

ObjectIdClass · 0.90

Tested by

no test coverage detected