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

Method test_comps

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

Source from the content-addressed store, hash-verified

1474
1475class TestDatetimeConversion(unittest.TestCase):
1476 def test_comps(self):
1477 # Tests other timestamp formats.
1478 # Test each of the rich comparison methods.
1479 pairs = [
1480 (DatetimeMS(-1), DatetimeMS(1)),
1481 (DatetimeMS(0), DatetimeMS(0)),
1482 (DatetimeMS(1), DatetimeMS(-1)),
1483 ]
1484
1485 comp_ops = ["__lt__", "__le__", "__eq__", "__ne__", "__gt__", "__ge__"]
1486 for lh, rh in pairs:
1487 for op in comp_ops:
1488 self.assertEqual(getattr(lh, op)(rh), getattr(lh._value, op)(rh._value))
1489
1490 def test_class_conversions(self):
1491 # Test class conversions.

Callers

nothing calls this directly

Calls 1

DatetimeMSClass · 0.90

Tested by

no test coverage detected