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

Method test_unbind_all

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

Source from the content-addressed store, hash-verified

1131 self.assertCommandExist(funcid2)
1132
1133 def test_unbind_all(self):
1134 event = '<Control-Alt-Key-i>'
1135 bind_all = self.root.bind_all
1136 unbind_all = self.root.unbind_all
1137 self.assertNotIn(event, bind_all())
1138 self.assertEqual(bind_all(event), '')
1139 self.addCleanup(unbind_all, event)
1140 def test1(e): pass
1141 def test2(e): pass
1142
1143 funcid = bind_all(event, test1)
1144 funcid2 = bind_all(event, test2, add=True)
1145
1146 unbind_all(event)
1147 self.assertEqual(bind_all(event), '')
1148 self.assertNotIn(event, bind_all())
1149 self.assertCommandExist(funcid)
1150 self.assertCommandExist(funcid2)
1151
1152 unbind_all(event) # idempotent
1153
1154 def test_bind_all_rebind(self):
1155 event = '<Control-Alt-Key-j>'

Callers

nothing calls this directly

Calls 4

assertCommandExistMethod · 0.95
assertNotInMethod · 0.80
addCleanupMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected