(self)
| 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>' |
nothing calls this directly
no test coverage detected