test_help.py 849 B

12345678910111213141516171819202122232425262728293031323334
  1. "Test help, coverage 87%."
  2. from idlelib import help
  3. import unittest
  4. from test.support import requires
  5. requires('gui')
  6. from os.path import abspath, dirname, join
  7. from tkinter import Tk
  8. class HelpFrameTest(unittest.TestCase):
  9. @classmethod
  10. def setUpClass(cls):
  11. "By itself, this tests that file parsed without exception."
  12. cls.root = root = Tk()
  13. root.withdraw()
  14. helpfile = join(dirname(dirname(abspath(__file__))), 'help.html')
  15. cls.frame = help.HelpFrame(root, helpfile)
  16. @classmethod
  17. def tearDownClass(cls):
  18. del cls.frame
  19. cls.root.update_idletasks()
  20. cls.root.destroy()
  21. del cls.root
  22. def test_line1(self):
  23. text = self.frame.text
  24. self.assertEqual(text.get('1.0', '1.end'), ' IDLE ')
  25. if __name__ == '__main__':
  26. unittest.main(verbosity=2)