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

Method test_equality

test/test_code.py:72–86  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

70 self.assertEqual(repr(c), "Code({}, None)".format(repr("\x08\xFF")))
71
72 def test_equality(self):
73 b = Code("hello")
74 c = Code("hello", {"foo": 5})
75 self.assertNotEqual(b, c)
76 self.assertEqual(c, Code("hello", {"foo": 5}))
77 self.assertNotEqual(c, Code("hello", {"foo": 6}))
78 self.assertEqual(b, Code("hello"))
79 self.assertEqual(b, Code("hello", None))
80 self.assertNotEqual(b, Code("hello "))
81 self.assertNotEqual("hello", Code("hello"))
82
83 # Explicitly test inequality
84 self.assertFalse(c != Code("hello", {"foo": 5}))
85 self.assertFalse(b != Code("hello"))
86 self.assertFalse(b != Code("hello", None))
87
88 def test_hash(self):
89 self.assertRaises(TypeError, hash, Code("hello world"))

Callers

nothing calls this directly

Calls 1

CodeClass · 0.90

Tested by

no test coverage detected