2018-06-18 05:47:59 -03:00
|
|
|
"Test mainmenu, coverage 100%."
|
|
|
|
# Reported as 88%; mocking turtledemo absence would have no point.
|
|
|
|
|
|
|
|
from idlelib import mainmenu
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
|
|
class MainMenuTest(unittest.TestCase):
|
|
|
|
|
|
|
|
def test_menudefs(self):
|
|
|
|
actual = [item[0] for item in mainmenu.menudefs]
|
|
|
|
expect = ['file', 'edit', 'format', 'run', 'shell',
|
2018-06-20 23:49:55 -03:00
|
|
|
'debug', 'options', 'window', 'help']
|
2018-06-18 05:47:59 -03:00
|
|
|
self.assertEqual(actual, expect)
|
|
|
|
|
|
|
|
def test_default_keydefs(self):
|
|
|
|
self.assertGreaterEqual(len(mainmenu.default_keydefs), 50)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main(verbosity=2)
|