test_autocomplete_w.py 709 B

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