summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test/test_help_about.py
diff options
context:
space:
mode:
authorcsabella <cheryl.sabella@gmail.com>2017-06-29 22:42:17 (GMT)
committerterryjreedy <tjreedy@udel.edu>2017-06-29 22:42:17 (GMT)
commit42bc8beadd49f60cc52fdc397897b3bd81640406 (patch)
tree5c61554842c2156ef44ee64eb835c44bc9621ab8 /Lib/idlelib/idle_test/test_help_about.py
parent18974c35ad9d25ffea041dc0363dc01889f4a595 (diff)
downloadcpython-42bc8beadd49f60cc52fdc397897b3bd81640406.zip
cpython-42bc8beadd49f60cc52fdc397897b3bd81640406.tar.gz
cpython-42bc8beadd49f60cc52fdc397897b3bd81640406.tar.bz2
bpo-30495: IDLE: improve textview with docstrings, PEP8 names, more tests. (#2283)
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.
Diffstat (limited to 'Lib/idlelib/idle_test/test_help_about.py')
-rw-r--r--Lib/idlelib/idle_test/test_help_about.py23
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()