diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2017-09-30 23:54:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-30 23:54:28 (GMT) |
commit | d6bb65f378e34fe0c11fdb39588357ecf22964eb (patch) | |
tree | 5cdcb340f58d22e9e04a7a0ed043a91e57847dff /Lib/idlelib/idle_test | |
parent | bfebfd81de21b7906df386fce845f2b1f5ffd212 (diff) | |
download | cpython-d6bb65f378e34fe0c11fdb39588357ecf22964eb.zip cpython-d6bb65f378e34fe0c11fdb39588357ecf22964eb.tar.gz cpython-d6bb65f378e34fe0c11fdb39588357ecf22964eb.tar.bz2 |
bpo-31460: Simplify the API of IDLE's Module Browser. (#3842)
Passing a widget instead of an flist with a root widget opens the option of
creating a browser frame that is only part of a window. Passing a full file
name instead of pieces assumed to come from a .py file opens the possibility
of browsing python files that do not end in .py.
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r-- | Lib/idlelib/idle_test/test_browser.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/Lib/idlelib/idle_test/test_browser.py b/Lib/idlelib/idle_test/test_browser.py index a4add89..59e03c5 100644 --- a/Lib/idlelib/idle_test/test_browser.py +++ b/Lib/idlelib/idle_test/test_browser.py @@ -24,30 +24,24 @@ class ModuleBrowserTest(unittest.TestCase): requires('gui') cls.root = Tk() cls.root.withdraw() - cls.flist = filelist.FileList(cls.root) - cls.file = __file__ - cls.path = os.path.dirname(cls.file) - cls.module = os.path.basename(cls.file).rstrip('.py') - cls.mb = browser.ModuleBrowser(cls.flist, cls.module, [cls.path], _utest=True) + cls.mb = browser.ModuleBrowser(cls.root, __file__, _utest=True) @classmethod def tearDownClass(cls): cls.mb.close() cls.root.destroy() - del cls.root, cls.flist, cls.mb + del cls.root, cls.mb def test_init(self): mb = self.mb eq = self.assertEqual - eq(mb.name, self.module) - eq(mb.file, self.file) - eq(mb.flist, self.flist) + eq(mb.path, __file__) eq(pyclbr._modules, {}) self.assertIsInstance(mb.node, TreeNode) def test_settitle(self): mb = self.mb - self.assertIn(self.module, mb.top.title()) + self.assertIn(os.path.basename(__file__), mb.top.title()) self.assertEqual(mb.top.iconname(), 'Module Browser') def test_rootnode(self): |