2018-06-15 19:38:35 -03:00
|
|
|
"Test help, coverage 87%."
|
2016-06-10 19:19:21 -03:00
|
|
|
|
|
|
|
from idlelib import help
|
2018-06-15 19:38:35 -03:00
|
|
|
import unittest
|
2016-06-10 19:19:21 -03:00
|
|
|
from test.support import requires
|
|
|
|
requires('gui')
|
|
|
|
from os.path import abspath, dirname, join
|
|
|
|
from tkinter import Tk
|
2018-06-15 19:38:35 -03:00
|
|
|
|
2016-06-10 19:19:21 -03:00
|
|
|
|
|
|
|
class HelpFrameTest(unittest.TestCase):
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def setUpClass(cls):
|
|
|
|
"By itself, this tests that file parsed without exception."
|
|
|
|
cls.root = root = Tk()
|
|
|
|
root.withdraw()
|
2016-07-05 22:51:56 -03:00
|
|
|
helpfile = join(dirname(dirname(abspath(__file__))), 'help.html')
|
2016-06-10 19:19:21 -03:00
|
|
|
cls.frame = help.HelpFrame(root, helpfile)
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def tearDownClass(cls):
|
|
|
|
del cls.frame
|
|
|
|
cls.root.update_idletasks()
|
|
|
|
cls.root.destroy()
|
|
|
|
del cls.root
|
|
|
|
|
|
|
|
def test_line1(self):
|
|
|
|
text = self.frame.text
|
|
|
|
self.assertEqual(text.get('1.0', '1.end'), ' IDLE ')
|
|
|
|
|
2018-06-15 19:38:35 -03:00
|
|
|
|
2016-06-10 19:19:21 -03:00
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main(verbosity=2)
|