diff options
author | terryjreedy <tjreedy@udel.edu> | 2017-06-29 23:15:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-29 23:15:18 (GMT) |
commit | 6f31717c47e325460e2a661bf44b45d342d65bcb (patch) | |
tree | 5b68309a4788153ba3d04b83f706a5ae440aa3db /Lib/idlelib/idle_test/test_help_about.py | |
parent | 1d56ed5210babb68b5798cd943bb21f417e781ee (diff) | |
download | cpython-6f31717c47e325460e2a661bf44b45d342d65bcb.zip cpython-6f31717c47e325460e2a661bf44b45d342d65bcb.tar.gz cpython-6f31717c47e325460e2a661bf44b45d342d65bcb.tar.bz2 |
[3.6] bpo-30495: IDLE: improve textview with docstrings, PEP8 names, more tests. (GH-2283) (#2496)
Split TextViewer class into ViewWindow, ViewFrame, and TextFrame classes so that instances
of the latter two can be placed with other widgets within a multiframe window.
Patch by Cheryl Sabella.
(cherry picked from commit 42bc8be)
Diffstat (limited to 'Lib/idlelib/idle_test/test_help_about.py')
-rw-r--r-- | Lib/idlelib/idle_test/test_help_about.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/Lib/idlelib/idle_test/test_help_about.py b/Lib/idlelib/idle_test/test_help_about.py index 08c38a5..1f67aad 100644 --- a/Lib/idlelib/idle_test/test_help_about.py +++ b/Lib/idlelib/idle_test/test_help_about.py @@ -50,19 +50,17 @@ class LiveDialogTest(unittest.TestCase): def test_printer_buttons(self): """Test buttons whose commands use printer function.""" dialog = self.dialog - button_sources = [(self.dialog.py_license, license), - (self.dialog.py_copyright, copyright), - (self.dialog.py_credits, credits)] + button_sources = [(dialog.py_license, license), + (dialog.py_copyright, copyright), + (dialog.py_credits, credits)] for button, printer in button_sources: printer._Printer__setup() button.invoke() + get = dialog._current_textview.viewframe.textframe.text.get + self.assertEqual(printer._Printer__lines[0], get('1.0', '1.end')) self.assertEqual( - printer._Printer__lines[0], - dialog._current_textview.text.get('1.0', '1.end')) - self.assertEqual( - printer._Printer__lines[1], - dialog._current_textview.text.get('2.0', '2.end')) + printer._Printer__lines[1], get('2.0', '2.end')) dialog._current_textview.destroy() def test_file_buttons(self): @@ -75,14 +73,11 @@ class LiveDialogTest(unittest.TestCase): for button, filename in button_sources: button.invoke() fn = findfile(filename, subdir='idlelib') + get = dialog._current_textview.viewframe.textframe.text.get with open(fn) as f: - self.assertEqual( - f.readline().strip(), - dialog._current_textview.text.get('1.0', '1.end')) + self.assertEqual(f.readline().strip(), get('1.0', '1.end')) f.readline() - self.assertEqual( - f.readline().strip(), - dialog._current_textview.text.get('3.0', '3.end')) + self.assertEqual(f.readline().strip(), get('3.0', '3.end')) dialog._current_textview.destroy() |