diff options
| author | Terry Jan Reedy <tjreedy@udel.edu> | 2018-06-19 23:12:52 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-19 23:12:52 (GMT) |
| commit | 4d92158f4c3917fc4fbfebff15224e74782abf79 (patch) | |
| tree | a3eea4b4e5e9d9b9b679eb538d9716758776c3bb /Lib/idlelib/idle_test/test_rstrip.py | |
| parent | 00f9edb98dd64e14daf5c44f303deca5cbc3cdeb (diff) | |
| download | cpython-4d92158f4c3917fc4fbfebff15224e74782abf79.zip cpython-4d92158f4c3917fc4fbfebff15224e74782abf79.tar.gz cpython-4d92158f4c3917fc4fbfebff15224e74782abf79.tar.bz2 | |
bpo-33855: Still more edits and minimal tests for IDLE (GH-7784)
Part 3 of 3, continuing PR #7689. This covers 14 idlelib modules and their tests,
rpc to zoomheight except for run (already done) and tooltip (being done separately).
Diffstat (limited to 'Lib/idlelib/idle_test/test_rstrip.py')
| -rw-r--r-- | Lib/idlelib/idle_test/test_rstrip.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Lib/idlelib/idle_test/test_rstrip.py b/Lib/idlelib/idle_test/test_rstrip.py index 130e6be..9ef1320 100644 --- a/Lib/idlelib/idle_test/test_rstrip.py +++ b/Lib/idlelib/idle_test/test_rstrip.py @@ -1,5 +1,7 @@ +"Test rstrip, coverage 100%." + +from idlelib import rstrip import unittest -import idlelib.rstrip as rs from idlelib.idle_test.mock_idle import Editor class rstripTest(unittest.TestCase): @@ -7,7 +9,7 @@ class rstripTest(unittest.TestCase): def test_rstrip_line(self): editor = Editor() text = editor.text - do_rstrip = rs.RstripExtension(editor).do_rstrip + do_rstrip = rstrip.RstripExtension(editor).do_rstrip do_rstrip() self.assertEqual(text.get('1.0', 'insert'), '') @@ -20,12 +22,12 @@ class rstripTest(unittest.TestCase): def test_rstrip_multiple(self): editor = Editor() - # Uncomment following to verify that test passes with real widgets. -## from idlelib.editor import EditorWindow as Editor -## from tkinter import Tk -## editor = Editor(root=Tk()) + # Comment above, uncomment 3 below to test with real Editor & Text. + #from idlelib.editor import EditorWindow as Editor + #from tkinter import Tk + #editor = Editor(root=Tk()) text = editor.text - do_rstrip = rs.RstripExtension(editor).do_rstrip + do_rstrip = rstrip.RstripExtension(editor).do_rstrip original = ( "Line with an ending tab \n" @@ -45,5 +47,7 @@ class rstripTest(unittest.TestCase): do_rstrip() self.assertEqual(text.get('1.0', 'insert'), stripped) + + if __name__ == '__main__': - unittest.main(verbosity=2, exit=False) + unittest.main(verbosity=2) |
