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

Method test_dbref_pickling

test/test_bson.py:1412–1433  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1410 self.round_trip_pickle(ts, pickled_with_3)
1411
1412 def test_dbref_pickling(self):
1413 dbr = DBRef("foo", 5)
1414 pickled_with_3 = (
1415 b"\x80\x04\x95q\x00\x00\x00\x00\x00\x00\x00\x8c\n"
1416 b"bson.dbref\x94\x8c\x05DBRef\x94\x93\x94)\x81\x94}"
1417 b"\x94(\x8c\x12_DBRef__collection\x94\x8c\x03foo\x94"
1418 b"\x8c\n_DBRef__id\x94K\x05\x8c\x10_DBRef__database"
1419 b"\x94N\x8c\x0e_DBRef__kwargs\x94}\x94ub."
1420 )
1421 self.round_trip_pickle(dbr, pickled_with_3)
1422
1423 dbr = DBRef("foo", 5, database="db", kwargs1=None)
1424 pickled_with_3 = (
1425 b"\x80\x04\x95\x81\x00\x00\x00\x00\x00\x00\x00\x8c"
1426 b"\nbson.dbref\x94\x8c\x05DBRef\x94\x93\x94)\x81\x94}"
1427 b"\x94(\x8c\x12_DBRef__collection\x94\x8c\x03foo\x94"
1428 b"\x8c\n_DBRef__id\x94K\x05\x8c\x10_DBRef__database"
1429 b"\x94\x8c\x02db\x94\x8c\x0e_DBRef__kwargs\x94}\x94"
1430 b"\x8c\x07kwargs1\x94Nsub."
1431 )
1432
1433 self.round_trip_pickle(dbr, pickled_with_3)
1434
1435 def test_minkey_pickling(self):
1436 mink = MinKey()

Callers

nothing calls this directly

Calls 2

round_trip_pickleMethod · 0.95
DBRefClass · 0.90

Tested by

no test coverage detected