diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-07-18 01:21:08 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2019-07-18 01:21:08 (GMT) |
commit | 028f1d2479a9a508e1f0bfcff42c20c348244549 (patch) | |
tree | 083cd627ec4c0ae931214571961e476b483ff9ae /Lib/idlelib/idle_test/test_rstrip.py | |
parent | 635743355d9dbffdc9aa7a2cc8de1403fbdb8d9b (diff) | |
download | cpython-028f1d2479a9a508e1f0bfcff42c20c348244549.zip cpython-028f1d2479a9a508e1f0bfcff42c20c348244549.tar.gz cpython-028f1d2479a9a508e1f0bfcff42c20c348244549.tar.bz2 |
bpo-36390: Gather IDLE Format menu functions into format.py (GH-14827) (GH-14829)
Add two indent spec methods from editor and Rstrip to existing file.
Tests are not added for indent methods because they need change
in lights of 3.x's prohibition on mixing tabs and spaces.
(cherry picked from commit 1b3892243433da7eae7f5f3a4f98f13d309c8926)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib/idle_test/test_rstrip.py')
-rw-r--r-- | Lib/idlelib/idle_test/test_rstrip.py | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/Lib/idlelib/idle_test/test_rstrip.py b/Lib/idlelib/idle_test/test_rstrip.py deleted file mode 100644 index 2bc7c6f..0000000 --- a/Lib/idlelib/idle_test/test_rstrip.py +++ /dev/null @@ -1,53 +0,0 @@ -"Test rstrip, coverage 100%." - -from idlelib import rstrip -import unittest -from idlelib.idle_test.mock_idle import Editor - -class rstripTest(unittest.TestCase): - - def test_rstrip_line(self): - editor = Editor() - text = editor.text - do_rstrip = rstrip.Rstrip(editor).do_rstrip - - do_rstrip() - self.assertEqual(text.get('1.0', 'insert'), '') - text.insert('1.0', ' ') - do_rstrip() - self.assertEqual(text.get('1.0', 'insert'), '') - text.insert('1.0', ' \n') - do_rstrip() - self.assertEqual(text.get('1.0', 'insert'), '\n') - - def test_rstrip_multiple(self): - editor = Editor() - # 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 = rstrip.Rstrip(editor).do_rstrip - - original = ( - "Line with an ending tab \n" - "Line ending in 5 spaces \n" - "Linewithnospaces\n" - " indented line\n" - " indented line with trailing space \n" - " ") - stripped = ( - "Line with an ending tab\n" - "Line ending in 5 spaces\n" - "Linewithnospaces\n" - " indented line\n" - " indented line with trailing space\n") - - text.insert('1.0', original) - do_rstrip() - self.assertEqual(text.get('1.0', 'insert'), stripped) - - - -if __name__ == '__main__': - unittest.main(verbosity=2) |