2024-01-06 02:23:26 -04:00
|
|
|
"Test help, coverage 94%."
|
2016-06-10 19:19:21 -03:00
|
|
|
|
|
|
|
from idlelib import help
|
2018-06-15 19:20:55 -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:20:55 -03:00
|
|
|
|
2016-06-10 19:19:21 -03:00
|
|
|
|
2024-01-06 02:23:26 -04:00
|
|
|
class IdleDocTest(unittest.TestCase):
|
2016-06-10 19:19:21 -03:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def setUpClass(cls):
|
|
|
|
"By itself, this tests that file parsed without exception."
|
|
|
|
cls.root = root = Tk()
|
|
|
|
root.withdraw()
|
2024-01-06 02:23:26 -04:00
|
|
|
cls.window = help.show_idlehelp(root)
|
2016-06-10 19:19:21 -03:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def tearDownClass(cls):
|
2024-01-06 02:23:26 -04:00
|
|
|
del cls.window
|
2016-06-10 19:19:21 -03:00
|
|
|
cls.root.update_idletasks()
|
|
|
|
cls.root.destroy()
|
|
|
|
del cls.root
|
|
|
|
|
2024-01-06 02:23:26 -04:00
|
|
|
def test_1window(self):
|
|
|
|
self.assertIn('IDLE Doc', self.window.wm_title())
|
|
|
|
|
|
|
|
def test_4text(self):
|
|
|
|
text = self.window.frame.text
|
2016-06-10 19:19:21 -03:00
|
|
|
self.assertEqual(text.get('1.0', '1.end'), ' IDLE ')
|
|
|
|
|
2018-06-15 19:20:55 -03:00
|
|
|
|
2016-06-10 19:19:21 -03:00
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main(verbosity=2)
|