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

Method test_decode_all_no_options

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

Source from the content-addressed store, hash-verified

1318 bson.decode_all(bson.encode({"uuid": uuid.uuid4()}))
1319
1320 def test_decode_all_no_options(self):
1321 # Test decode_all()'s default document_class is dict and tz_aware is
1322 # False.
1323 doc = {"sub_document": {}, "dt": datetime.datetime.now(tz=datetime.timezone.utc)}
1324
1325 decoded = bson.decode_all(bson.encode(doc), None)[0]
1326 self.assertIsInstance(decoded["sub_document"], dict)
1327 self.assertIsNone(decoded["dt"].tzinfo)
1328
1329 doc2 = {"id": Binary.from_uuid(uuid.uuid4())}
1330 decoded = bson.decode_all(bson.encode(doc2), None)[0]
1331 self.assertIsInstance(decoded["id"], Binary)
1332
1333 def test_decode_all_kwarg(self):
1334 doc = {"a": uuid.uuid4()}

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.80
from_uuidMethod · 0.80

Tested by

no test coverage detected