def test_compare(self): endpoint1 = Mock() endpoint1.name = "test-endpoint" endpoint2 = Mock() endpoint2.name = "test-endpoint" test1 = Record({}, None, endpoint1) test1.id = 1 test2 = Record({}, None, endpoint2) test2.id = 1 self.assertEqual(test1, test2)
def test_hash_diff(self): endpoint1 = Mock() endpoint1.name = "test-endpoint" endpoint2 = Mock() endpoint2.name = "test-endpoint" test1 = Record({}, None, endpoint1) test1.id = 1 test2 = Record({}, None, endpoint2) test2.id = 2 self.assertNotEqual(hash(test1), hash(test2))