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

Method test_equality

test/test_objectid.py:73–82  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

71 )
72
73 def test_equality(self):
74 a = ObjectId()
75 self.assertEqual(a, ObjectId(a))
76 self.assertEqual(ObjectId(b"123456789012"), ObjectId(b"123456789012"))
77 self.assertNotEqual(ObjectId(), ObjectId())
78 self.assertNotEqual(ObjectId(b"123456789012"), b"123456789012")
79
80 # Explicitly test inequality
81 self.assertFalse(a != ObjectId(a))
82 self.assertFalse(ObjectId(b"123456789012") != ObjectId(b"123456789012"))
83
84 def test_binary_str_equivalence(self):
85 a = ObjectId()

Callers

nothing calls this directly

Calls 1

ObjectIdClass · 0.90

Tested by

no test coverage detected