Skip to content

Commit 70f31c8

Browse files
committed
-
1 parent ed31195 commit 70f31c8

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

source_py3/test_python_toolbox/test_sleek_reffing/test_cute_sleek_value_dict/test_generic_dict_tests.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -567,36 +567,36 @@ def test_tuple_keyerror(self):
567567
#self.assertEqual(c.exception.args, ((1,),))
568568

569569

570-
def test_bad_key(self):
571-
# Dictionary lookups should fail if __cmp__() raises an exception.
572-
class CustomException(Exception):
573-
pass
574-
575-
class BadDictKey:
576-
def __hash__(self):
577-
return hash(self.__class__)
570+
#def test_bad_key(self):
571+
## Dictionary lookups should fail if __cmp__() raises an exception.
572+
#class CustomException(Exception):
573+
#pass
578574

579-
def __cmp__(self, other):
580-
if isinstance(other, self.__class__):
581-
raise CustomException
582-
return other
583-
584-
d = CuteSleekValueDict(null_callback)
585-
x1 = BadDictKey()
586-
x2 = BadDictKey()
587-
d[x1] = 1
588-
locals()['CuteSleekValueDict'] = CuteSleekValueDict
589-
locals()['null_callback'] = null_callback
590-
for stmt in ['d[x2] = 2',
591-
'z = d[x2]',
592-
'x2 in d',
593-
'd.has_key(x2)',
594-
'd.get(x2)',
595-
'd.setdefault(x2, 42)',
596-
'd.pop(x2)',
597-
'd.update(CuteSleekValueDict(null_callback, {x2: 2}))']:
598-
with self.assertRaises(CustomException):
599-
exec(stmt, locals())
575+
#class BadDictKey:
576+
#def __hash__(self):
577+
#return hash(self.__class__)
578+
579+
#def __lt__(self, other):
580+
#if isinstance(other, self.__class__):
581+
#raise CustomException
582+
#return other
583+
584+
#d = CuteSleekValueDict(null_callback)
585+
#x1 = BadDictKey()
586+
#x2 = BadDictKey()
587+
#d[x1] = 1
588+
#locals()['CuteSleekValueDict'] = CuteSleekValueDict
589+
#locals()['null_callback'] = null_callback
590+
#for stmt in ['d[x2] = 2',
591+
#'z = d[x2]',
592+
#'x2 in d',
593+
#'d.has_key(x2)',
594+
#'d.get(x2)',
595+
#'d.setdefault(x2, 42)',
596+
#'d.pop(x2)',
597+
#'d.update(CuteSleekValueDict(null_callback, {x2: 2}))']:
598+
#with self.assertRaises(CustomException):
599+
#exec(stmt, locals())
600600

601601

602602
def test_resize1(self):

0 commit comments

Comments
 (0)