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

Method test_bind_rebind

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

Source from the content-addressed store, hash-verified

1009 self.assertRaises(tkinter.TclError, f.unbind, event, funcid2)
1010
1011 def test_bind_rebind(self):
1012 event = '<Control-Alt-Key-d>'
1013 f = self.frame
1014 self.assertEqual(f.bind(), ())
1015 self.assertEqual(f.bind(event), '')
1016 def test1(e): pass
1017 def test2(e): pass
1018 def test3(e): pass
1019
1020 funcid = f.bind(event, test1)
1021 funcid2 = f.bind(event, test2, add=True)
1022 script = f.bind(event)
1023 self.assertIn(funcid2, script)
1024 self.assertIn(funcid, script)
1025 self.assertCommandExist(funcid)
1026 self.assertCommandExist(funcid2)
1027
1028 funcid3 = f.bind(event, test3)
1029 script = f.bind(event)
1030 self.assertNotIn(funcid, script)
1031 self.assertNotIn(funcid2, script)
1032 self.assertIn(funcid3, script)
1033 self.assertCommandExist(funcid3)
1034
1035 def test_bind_class(self):
1036 event = '<Control-Alt-Key-e>'

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected