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

Method test_bind_class

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

Source from the content-addressed store, hash-verified

1033 self.assertCommandExist(funcid3)
1034
1035 def test_bind_class(self):
1036 event = '<Control-Alt-Key-e>'
1037 bind_class = self.root.bind_class
1038 unbind_class = self.root.unbind_class
1039 self.assertRaises(TypeError, bind_class)
1040 self.assertEqual(bind_class('Test'), ())
1041 self.assertEqual(bind_class('Test', event), '')
1042 self.addCleanup(unbind_class, 'Test', event)
1043 def test1(e): pass
1044 def test2(e): pass
1045
1046 funcid = bind_class('Test', event, test1)
1047 self.assertEqual(bind_class('Test'), (event,))
1048 script = bind_class('Test', event)
1049 self.assertIn(funcid, script)
1050 self.assertCommandExist(funcid)
1051
1052 funcid2 = bind_class('Test', event, test2, add=True)
1053 script = bind_class('Test', event)
1054 self.assertIn(funcid, script)
1055 self.assertIn(funcid2, script)
1056 self.assertCommandExist(funcid)
1057 self.assertCommandExist(funcid2)
1058
1059 def test_unbind_class(self):
1060 event = '<Control-Alt-Key-f>'

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected