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

Method test_bind

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

Source from the content-addressed store, hash-verified

926 self.assertEqual(_info_commands(self.root, funcid), ())
927
928 def test_bind(self):
929 event = '<Control-Alt-Key-a>'
930 f = self.frame
931 self.assertEqual(f.bind(), ())
932 self.assertEqual(f.bind(event), '')
933 def test1(e): pass
934 def test2(e): pass
935
936 funcid = f.bind(event, test1)
937 self.assertEqual(f.bind(), (event,))
938 script = f.bind(event)
939 self.assertIn(funcid, script)
940 self.assertCommandExist(funcid)
941
942 funcid2 = f.bind(event, test2, add=True)
943 script = f.bind(event)
944 self.assertIn(funcid, script)
945 self.assertIn(funcid2, script)
946 self.assertCommandExist(funcid)
947 self.assertCommandExist(funcid2)
948
949 def test_unbind(self):
950 event = '<Control-Alt-Key-b>'

Callers

nothing calls this directly

Calls 4

assertCommandExistMethod · 0.95
assertInMethod · 0.80
assertEqualMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected