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

Method test_large_datetime_truncation

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

Source from the content-addressed store, hash-verified

606 self.assertEqual(dt1, dt2)
607
608 def test_large_datetime_truncation(self):
609 # Ensure that a large datetime is truncated correctly.
610 dt1 = datetime.datetime(9999, 1, 1, 1, 1, 1, 999999)
611 dt2 = decode(encode({"date": dt1}))["date"]
612 self.assertEqual(dt2.microsecond, 999000)
613 self.assertEqual(dt2.second, dt1.second)
614
615 def test_aware_datetime(self):
616 aware = datetime.datetime(1993, 4, 4, 2, tzinfo=FixedOffset(555, "SomeZone"))

Callers

nothing calls this directly

Calls 2

decodeFunction · 0.90
encodeFunction · 0.90

Tested by

no test coverage detected