| 1 | "Test autocomplete_w, coverage 11%." |
| 2 | |
| 3 | import unittest |
| 4 | from test.support import requires |
| 5 | from tkinter import Tk, Text |
| 6 | |
| 7 | import idlelib.autocomplete_w as acw |
| 8 | |
| 9 | |
| 10 | class AutoCompleteWindowTest(unittest.TestCase): |
| 11 | |
| 12 | @classmethod |
| 13 | def setUpClass(cls): |
| 14 | requires('gui') |
| 15 | cls.root = Tk() |
| 16 | cls.root.withdraw() |
| 17 | cls.text = Text(cls.root) |
| 18 | cls.acw = acw.AutoCompleteWindow(cls.text, tags=None) |
| 19 | |
| 20 | @classmethod |
| 21 | def tearDownClass(cls): |
| 22 | del cls.text, cls.acw |
| 23 | cls.root.update_idletasks() |
| 24 | cls.root.destroy() |
| 25 | del cls.root |
| 26 | |
| 27 | def test_init(self): |
| 28 | self.assertEqual(self.acw.widget, self.text) |
| 29 | |
| 30 | |
| 31 | if __name__ == '__main__': |
| 32 | unittest.main(verbosity=2) |