MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_bad_dbref

Method test_bad_dbref

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

Source from the content-addressed store, hash-verified

573 self.assertEqual({"": DBRef("", ObjectId("5259b56afa5bd841d6585d99"))}, decode(bs))
574
575 def test_bad_dbref(self):
576 ref_only = {"ref": {"$ref": "collection"}}
577 id_only = {"ref": {"$id": ObjectId()}}
578
579 self.assertEqual(ref_only, decode(encode(ref_only)))
580 self.assertEqual(id_only, decode(encode(id_only)))
581
582 def test_bytes_as_keys(self):
583 doc = {b"foo": "bar"}

Callers

nothing calls this directly

Calls 3

ObjectIdClass · 0.90
decodeFunction · 0.90
encodeFunction · 0.90

Tested by

no test coverage detected