(root)/
Python-3.12.0/
Lib/
idlelib/
idle_test/
test_help.py
       1  "Test help, coverage 87%."
       2  
       3  from idlelib import help
       4  import unittest
       5  from test.support import requires
       6  requires('gui')
       7  from os.path import abspath, dirname, join
       8  from tkinter import Tk
       9  
      10  
      11  class ESC[4;38;5;81mHelpFrameTest(ESC[4;38;5;149munittestESC[4;38;5;149m.ESC[4;38;5;149mTestCase):
      12  
      13      @classmethod
      14      def setUpClass(cls):
      15          "By itself, this tests that file parsed without exception."
      16          cls.root = root = Tk()
      17          root.withdraw()
      18          helpfile = join(dirname(dirname(abspath(__file__))), 'help.html')
      19          cls.frame = help.HelpFrame(root, helpfile)
      20  
      21      @classmethod
      22      def tearDownClass(cls):
      23          del cls.frame
      24          cls.root.update_idletasks()
      25          cls.root.destroy()
      26          del cls.root
      27  
      28      def test_line1(self):
      29          text = self.frame.text
      30          self.assertEqual(text.get('1.0', '1.end'), ' IDLE ')
      31  
      32  
      33  if __name__ == '__main__':
      34      unittest.main(verbosity=2)