(self)
| 1057 | self.assertCommandExist(funcid2) |
| 1058 | |
| 1059 | def test_unbind_class(self): |
| 1060 | event = '<Control-Alt-Key-f>' |
| 1061 | bind_class = self.root.bind_class |
| 1062 | unbind_class = self.root.unbind_class |
| 1063 | self.assertEqual(bind_class('Test'), ()) |
| 1064 | self.assertEqual(bind_class('Test', event), '') |
| 1065 | self.addCleanup(unbind_class, 'Test', event) |
| 1066 | def test1(e): pass |
| 1067 | def test2(e): pass |
| 1068 | |
| 1069 | funcid = bind_class('Test', event, test1) |
| 1070 | funcid2 = bind_class('Test', event, test2, add=True) |
| 1071 | |
| 1072 | self.assertRaises(TypeError, unbind_class) |
| 1073 | self.assertRaises(TypeError, unbind_class, 'Test') |
| 1074 | unbind_class('Test', event) |
| 1075 | self.assertEqual(bind_class('Test', event), '') |
| 1076 | self.assertEqual(bind_class('Test'), ()) |
| 1077 | self.assertCommandExist(funcid) |
| 1078 | self.assertCommandExist(funcid2) |
| 1079 | |
| 1080 | unbind_class('Test', event) # idempotent |
| 1081 | |
| 1082 | def test_bind_class_rebind(self): |
| 1083 | event = '<Control-Alt-Key-g>' |
nothing calls this directly
no test coverage detected