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

Method test_timestamp_highorder_bits

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

Source from the content-addressed store, hash-verified

1179 self.assertFalse(Timestamp(1, 0) > Timestamp(1, 0))
1180
1181 def test_timestamp_highorder_bits(self):
1182 doc = {"a": Timestamp(0xFFFFFFFF, 0xFFFFFFFF)}
1183 doc_bson = b"\x10\x00\x00\x00\x11a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00"
1184 self.assertEqual(doc_bson, encode(doc))
1185 self.assertEqual(doc, decode(doc_bson))
1186
1187 def test_bad_id_keys(self):
1188 self.assertRaises(InvalidDocument, encode, {"_id": {"$bad": 123}}, True)

Callers

nothing calls this directly

Calls 3

TimestampClass · 0.90
encodeFunction · 0.90
decodeFunction · 0.90

Tested by

no test coverage detected