MCPcopy Index your code
hub / github.com/python/cpython / test_unbind_class

Method test_unbind_class

Lib/test/test_tkinter/test_misc.py:1059–1080  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1057 self.assertCommandExist(funcid2)
1058
1059 def test_unbind_class(self):
1060 event = '<Control-Alt-Key-f>'
1061 bind_class = self.root.bind_class
1062 unbind_class = self.root.unbind_class
1063 self.assertEqual(bind_class('Test'), ())
1064 self.assertEqual(bind_class('Test', event), '')
1065 self.addCleanup(unbind_class, 'Test', event)
1066 def test1(e): pass
1067 def test2(e): pass
1068
1069 funcid = bind_class('Test', event, test1)
1070 funcid2 = bind_class('Test', event, test2, add=True)
1071
1072 self.assertRaises(TypeError, unbind_class)
1073 self.assertRaises(TypeError, unbind_class, 'Test')
1074 unbind_class('Test', event)
1075 self.assertEqual(bind_class('Test', event), '')
1076 self.assertEqual(bind_class('Test'), ())
1077 self.assertCommandExist(funcid)
1078 self.assertCommandExist(funcid2)
1079
1080 unbind_class('Test', event) # idempotent
1081
1082 def test_bind_class_rebind(self):
1083 event = '<Control-Alt-Key-g>'

Callers

nothing calls this directly

Calls 4

assertCommandExistMethod · 0.95
addCleanupMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected