bpo-33855: More edits and new minimal tests for IDLE (GH-7761)


Part 2 of 3.  Continues PR GH-7689, changeset ee5ef30.
Edit and add tests for 18 modules, help_about to replace and run.
(cherry picked from commit ea3dc8029ab6a0f1ee6a8a72f1612dea74892e08)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
diff --git a/Lib/idlelib/mainmenu.py b/Lib/idlelib/mainmenu.py
index 143570d..04acaed 100644
--- a/Lib/idlelib/mainmenu.py
+++ b/Lib/idlelib/mainmenu.py
@@ -36,7 +36,8 @@
    None,
    ('_Close', '<<close-window>>'),
    ('E_xit', '<<close-all-windows>>'),
-  ]),
+   ]),
+
  ('edit', [
    ('_Undo', '<<undo>>'),
    ('_Redo', '<<redo>>'),
@@ -56,9 +57,9 @@
    ('E_xpand Word', '<<expand-word>>'),
    ('Show C_all Tip', '<<force-open-calltip>>'),
    ('Show Surrounding P_arens', '<<flash-paren>>'),
+   ]),
 
-  ]),
-('format', [
+ ('format', [
    ('_Indent Region', '<<indent-region>>'),
    ('_Dedent Region', '<<dedent-region>>'),
    ('Comment _Out Region', '<<comment-region>>'),
@@ -70,30 +71,36 @@
    ('F_ormat Paragraph', '<<format-paragraph>>'),
    ('S_trip Trailing Whitespace', '<<do-rstrip>>'),
    ]),
+
  ('run', [
    ('Python Shell', '<<open-python-shell>>'),
    ('C_heck Module', '<<check-module>>'),
    ('R_un Module', '<<run-module>>'),
    ]),
+
  ('shell', [
    ('_View Last Restart', '<<view-restart>>'),
    ('_Restart Shell', '<<restart-shell>>'),
    None,
    ('_Interrupt Execution', '<<interrupt-execution>>'),
    ]),
+
  ('debug', [
    ('_Go to File/Line', '<<goto-file-line>>'),
    ('!_Debugger', '<<toggle-debugger>>'),
    ('_Stack Viewer', '<<open-stack-viewer>>'),
    ('!_Auto-open Stack Viewer', '<<toggle-jit-stack-viewer>>'),
    ]),
+
  ('options', [
    ('Configure _IDLE', '<<open-config-dialog>>'),
    ('_Code Context', '<<toggle-code-context>>'),
    ]),
+
  ('windows', [
    ('Zoom Height', '<<zoom-height>>'),
    ]),
+
  ('help', [
    ('_About IDLE', '<<about-idle>>'),
    None,
@@ -106,3 +113,7 @@
     menudefs[-1][1].append(('Turtle Demo', '<<open-turtle-demo>>'))
 
 default_keydefs = idleConf.GetCurrentKeySet()
+
+if __name__ == '__main__':
+    from unittest import main
+    main('idlelib.idle_test.test_mainmenu', verbosity=2)