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

Method test_bson_encode_decode

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

Source from the content-addressed store, hash-verified

1462 self.round_trip_pickle(i64, pickled_with_3)
1463
1464 def test_bson_encode_decode(self) -> None:
1465 doc = {"_id": ObjectId()}
1466 encoded = bson.encode(doc)
1467 decoded = bson.decode(encoded)
1468 encoded = bson.encode(decoded)
1469 decoded = bson.decode(encoded)
1470 # Documents returned from decode are mutable.
1471 decoded["new_field"] = 1
1472 self.assertTrue(decoded["_id"].generation_time)
1473
1474
1475class TestDatetimeConversion(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

ObjectIdClass · 0.90
encodeMethod · 0.80
decodeMethod · 0.80

Tested by

no test coverage detected