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

Method test_dbpointer

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

Source from the content-addressed store, hash-verified

562 self.fail("Failed to raise an exception.")
563
564 def test_dbpointer(self):
565 # *Note* - DBPointer and DBRef are *not* the same thing. DBPointer
566 # is a deprecated BSON type. DBRef is a convention that does not
567 # exist in the BSON spec, meant to replace DBPointer. PyMongo does
568 # not support creation of the DBPointer type, but will decode
569 # DBPointer to DBRef.
570
571 bs = b"\x18\x00\x00\x00\x0c\x00\x01\x00\x00\x00\x00RY\xb5j\xfa[\xd8A\xd6X]\x99\x00"
572
573 self.assertEqual({"": DBRef("", ObjectId("5259b56afa5bd841d6585d99"))}, decode(bs))
574
575 def test_bad_dbref(self):
576 ref_only = {"ref": {"$ref": "collection"}}

Callers

nothing calls this directly

Calls 3

DBRefClass · 0.90
ObjectIdClass · 0.90
decodeFunction · 0.90

Tested by

no test coverage detected