(self)
| 1152 | unbind_all(event) # idempotent |
| 1153 | |
| 1154 | def test_bind_all_rebind(self): |
| 1155 | event = '<Control-Alt-Key-j>' |
| 1156 | bind_all = self.root.bind_all |
| 1157 | unbind_all = self.root.unbind_all |
| 1158 | self.assertNotIn(event, bind_all()) |
| 1159 | self.assertEqual(bind_all(event), '') |
| 1160 | self.addCleanup(unbind_all, event) |
| 1161 | def test1(e): pass |
| 1162 | def test2(e): pass |
| 1163 | def test3(e): pass |
| 1164 | |
| 1165 | funcid = bind_all(event, test1) |
| 1166 | funcid2 = bind_all(event, test2, add=True) |
| 1167 | script = bind_all(event) |
| 1168 | self.assertIn(funcid2, script) |
| 1169 | self.assertIn(funcid, script) |
| 1170 | self.assertCommandExist(funcid) |
| 1171 | self.assertCommandExist(funcid2) |
| 1172 | |
| 1173 | funcid3 = bind_all(event, test3) |
| 1174 | script = bind_all(event) |
| 1175 | self.assertNotIn(funcid, script) |
| 1176 | self.assertNotIn(funcid2, script) |
| 1177 | self.assertIn(funcid3, script) |
| 1178 | self.assertCommandExist(funcid) |
| 1179 | self.assertCommandExist(funcid2) |
| 1180 | self.assertCommandExist(funcid3) |
| 1181 | |
| 1182 | def _test_tag_bind(self, w): |
| 1183 | tag = 'sel' |
nothing calls this directly
no test coverage detected