def METHOD_NAME(self):
    # With derived classes that doesn't override __cmp__, the behaviour
    # should be the same that with dicts:
    class derived_dict(dict): pass
    self.assertEqual(derived_dict(), {})
    self.assertNotEqual(derived_dict(), '')
    self.assertRaises(TypeError, derived_dict().__cmp__, '')
    # But, if they *override* __cmp__ and raise TypeError from there, we
    # have exception raised when checking for equality...
    class non_comparable_dict(dict):
        def __cmp__(self, other):
            raise TypeError, "I always raise TypeError"
    self.assertRaises(TypeError, lambda: non_comparable_dict() == '')
    self.assertRaises(TypeError, non_comparable_dict().__cmp__, '')
    # ...unless you compare it with other dicts:
    # self.assertEqual(non_comparable_dict(), {})
    # The same happens even if the overridden __cmp__ doesn't nothing apart
    # from calling super:
    class dummy_dict_with_cmp(dict):
        def __cmp__(self, other):
            return super(dummy_dict_with_cmp, self).__cmp__(other)
    self.assertEqual(dummy_dict_with_cmp(), {})
    # But TypeError is raised when comparing against other types
    self.assertRaises(TypeError, lambda: dummy_dict_with_cmp() == '')
    self.assertRaises(TypeError, dummy_dict_with_cmp().__cmp__, '')
    # Finally, the Python implementation shouldn't be tricked by not
    # implementing __cmp__ on the actual type of the dict-derived instance,
    # but implementing it on a superclass.
    class derived_dict_with_custom_cmp(dict):
        def __cmp__(self, other):
            return 0
    class yet_another_dict(derived_dict_with_custom_cmp): pass
    self.assertEqual(derived_dict_with_custom_cmp(), '')
    self.assertEqual(yet_another_dict(), '')