summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test
diff options
context:
space:
mode:
authorCheryl Sabella <cheryl.sabella@gmail.com>2017-09-23 20:46:01 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2017-09-23 20:46:01 (GMT)
commitcd99e79dc74c9d9dea83a5551d657c334b2cc6c9 (patch)
tree23aa523413523630c5676cf732476dc7e8dd47fd /Lib/idlelib/idle_test
parent99167f85b7373c8082b30a74211f009627bdedfa (diff)
downloadcpython-cd99e79dc74c9d9dea83a5551d657c334b2cc6c9.zip
cpython-cd99e79dc74c9d9dea83a5551d657c334b2cc6c9.tar.gz
cpython-cd99e79dc74c9d9dea83a5551d657c334b2cc6c9.tar.bz2
bpo-31459: Rename IDLE's module browser from Class Browser to Module Browser. (#3704)
The original module-level class and method browser became a module browser, with the addition of module-level functions, years ago. Nested classes and functions were added yesterday. For back- compatibility, the virtual event <<open-class-browser>>, which appears on the Keys tab of the Settings dialog, is not changed. Patch by Cheryl Sabella.
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r--Lib/idlelib/idle_test/htest.py2
-rw-r--r--Lib/idlelib/idle_test/test_browser.py42
2 files changed, 22 insertions, 22 deletions
diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py
index e483bbc..442f55e 100644
--- a/Lib/idlelib/idle_test/htest.py
+++ b/Lib/idlelib/idle_test/htest.py
@@ -86,7 +86,7 @@ _calltip_window_spec = {
"Typing ') should hide the calltip.\n"
}
-_class_browser_spec = {
+_module_browser_spec = {
'file': 'browser',
'kwds': {},
'msg': "Inspect names of module, class(with superclass if "
diff --git a/Lib/idlelib/idle_test/test_browser.py b/Lib/idlelib/idle_test/test_browser.py
index 3b1ece9..a4add89 100644
--- a/Lib/idlelib/idle_test/test_browser.py
+++ b/Lib/idlelib/idle_test/test_browser.py
@@ -17,7 +17,7 @@ from idlelib.idle_test.mock_idle import Func
from collections import deque
-class ClassBrowserTest(unittest.TestCase):
+class ModuleBrowserTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
@@ -28,41 +28,41 @@ class ClassBrowserTest(unittest.TestCase):
cls.file = __file__
cls.path = os.path.dirname(cls.file)
cls.module = os.path.basename(cls.file).rstrip('.py')
- cls.cb = browser.ClassBrowser(cls.flist, cls.module, [cls.path], _utest=True)
+ cls.mb = browser.ModuleBrowser(cls.flist, cls.module, [cls.path], _utest=True)
@classmethod
def tearDownClass(cls):
- cls.cb.close()
+ cls.mb.close()
cls.root.destroy()
- del cls.root, cls.flist, cls.cb
+ del cls.root, cls.flist, cls.mb
def test_init(self):
- cb = self.cb
+ mb = self.mb
eq = self.assertEqual
- eq(cb.name, self.module)
- eq(cb.file, self.file)
- eq(cb.flist, self.flist)
+ eq(mb.name, self.module)
+ eq(mb.file, self.file)
+ eq(mb.flist, self.flist)
eq(pyclbr._modules, {})
- self.assertIsInstance(cb.node, TreeNode)
+ self.assertIsInstance(mb.node, TreeNode)
def test_settitle(self):
- cb = self.cb
- self.assertIn(self.module, cb.top.title())
- self.assertEqual(cb.top.iconname(), 'Class Browser')
+ mb = self.mb
+ self.assertIn(self.module, mb.top.title())
+ self.assertEqual(mb.top.iconname(), 'Module Browser')
def test_rootnode(self):
- cb = self.cb
- rn = cb.rootnode()
+ mb = self.mb
+ rn = mb.rootnode()
self.assertIsInstance(rn, browser.ModuleBrowserTreeItem)
def test_close(self):
- cb = self.cb
- cb.top.destroy = Func()
- cb.node.destroy = Func()
- cb.close()
- self.assertTrue(cb.top.destroy.called)
- self.assertTrue(cb.node.destroy.called)
- del cb.top.destroy, cb.node.destroy
+ mb = self.mb
+ mb.top.destroy = Func()
+ mb.node.destroy = Func()
+ mb.close()
+ self.assertTrue(mb.top.destroy.called)
+ self.assertTrue(mb.node.destroy.called)
+ del mb.top.destroy, mb.node.destroy
# Nested tree same as in test_pyclbr.py except for supers on C0. C1.