(self)
| 50 | |
| 51 | @requires_tk(8, 6, 6) |
| 52 | def test_tk_busy(self): |
| 53 | root = self.root |
| 54 | f = tkinter.Frame(root, name='myframe') |
| 55 | f2 = tkinter.Frame(root) |
| 56 | f.pack() |
| 57 | f2.pack() |
| 58 | b = tkinter.Button(f) |
| 59 | b.pack() |
| 60 | f.tk_busy_hold() |
| 61 | with self.assertRaisesRegex(TclError, 'unknown option "-spam"'): |
| 62 | f.tk_busy_configure(spam='eggs') |
| 63 | with self.assertRaisesRegex(TclError, 'unknown option "-spam"'): |
| 64 | f.tk_busy_cget('spam') |
| 65 | with self.assertRaisesRegex(TclError, 'unknown option "-spam"'): |
| 66 | f.tk_busy_configure('spam') |
| 67 | self.assertIsInstance(f.tk_busy_configure(), dict) |
| 68 | |
| 69 | self.assertTrue(f.tk_busy_status()) |
| 70 | self.assertFalse(root.tk_busy_status()) |
| 71 | self.assertFalse(f2.tk_busy_status()) |
| 72 | self.assertFalse(b.tk_busy_status()) |
| 73 | self.assertIn(f, f.tk_busy_current()) |
| 74 | self.assertIn(f, f.tk_busy_current('*.m?f*me')) |
| 75 | self.assertNotIn(f, f.tk_busy_current('*spam')) |
| 76 | |
| 77 | f.tk_busy_forget() |
| 78 | self.assertFalse(f.tk_busy_status()) |
| 79 | self.assertFalse(f.tk_busy_current()) |
| 80 | errmsg = r"can(no|')t find busy window.*" |
| 81 | with self.assertRaisesRegex(TclError, errmsg): |
| 82 | f.tk_busy_configure() |
| 83 | with self.assertRaisesRegex(TclError, errmsg): |
| 84 | f.tk_busy_forget() |
| 85 | |
| 86 | @requires_tk(8, 6, 6) |
| 87 | def test_tk_busy_with_cursor(self): |
nothing calls this directly
no test coverage detected