PATH:
lib64
/
python2.7
/
idlelib
/
idle_test
import unittest import idlelib.RstripExtension as rs from idlelib.idle_test.mock_idle import Editor class rstripTest(unittest.TestCase): def test_rstrip_line(self): editor = Editor() text = editor.text do_rstrip = rs.RstripExtension(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() # Uncomment following to verify that test passes with real widgets. ## from idlelib.EditorWindow import EditorWindow as Editor ## from tkinter import Tk ## editor = Editor(root=Tk()) text = editor.text do_rstrip = rs.RstripExtension(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, exit=False)
[+]
..
[-] test_delegator.pyo
[edit]
[-] test_text.pyc
[edit]
[-] test_parenmatch.pyo
[edit]
[-] __init__.pyo
[edit]
[-] test_parenmatch.py
[edit]
[-] test_pathbrowser.pyc
[edit]
[-] test_warning.py
[edit]
[-] test_calltips.pyc
[edit]
[-] test_config_name.pyo
[edit]
[-] test_searchengine.pyo
[edit]
[-] mock_idle.pyc
[edit]
[-] htest.pyc
[edit]
[-] test_delegator.pyc
[edit]
[-] test_formatparagraph.py
[edit]
[-] mock_tk.pyc
[edit]
[-] mock_idle.pyo
[edit]
[-] test_searchdialogbase.pyc
[edit]
[-] test_searchdialogbase.pyo
[edit]
[-] test_hyperparser.py
[edit]
[-] test_searchengine.py
[edit]
[-] test_io.py
[edit]
[-] test_io.pyc
[edit]
[-] test_configdialog.pyc
[edit]
[-] test_textview.py
[edit]
[-] test_editmenu.py
[edit]
[-] test_helpabout.py
[edit]
[-] __init__.pyc
[edit]
[-] test_calltips.py
[edit]
[-] test_idlehistory.py
[edit]
[-] test_widgetredir.pyc
[edit]
[-] test_config_name.py
[edit]
[-] test_delegator.py
[edit]
[-] test_rstrip.pyc
[edit]
[-] __init__.py
[edit]
[-] test_searchengine.pyc
[edit]
[-] test_editmenu.pyc
[edit]
[-] test_configdialog.pyo
[edit]
[-] test_hyperparser.pyo
[edit]
[-] htest.py
[edit]
[-] test_warning.pyc
[edit]
[-] test_helpabout.pyc
[edit]
[-] test_grep.pyc
[edit]
[-] test_rstrip.py
[edit]
[-] mock_tk.pyo
[edit]
[-] test_pathbrowser.py
[edit]
[-] test_autoexpand.pyc
[edit]
[-] test_widgetredir.pyo
[edit]
[-] test_autocomplete.pyo
[edit]
[-] test_autoexpand.py
[edit]
[-] README.txt
[edit]
[-] test_formatparagraph.pyc
[edit]
[-] test_idlehistory.pyo
[edit]
[-] test_pathbrowser.pyo
[edit]
[-] test_autocomplete.py
[edit]
[-] test_warning.pyo
[edit]
[-] test_text.pyo
[edit]
[-] test_io.pyo
[edit]
[-] test_helpabout.pyo
[edit]
[-] test_textview.pyo
[edit]
[-] test_formatparagraph.pyo
[edit]
[-] htest.pyo
[edit]
[-] test_editmenu.pyo
[edit]
[-] test_idlehistory.pyc
[edit]
[-] test_grep.pyo
[edit]
[-] test_calltips.pyo
[edit]
[-] test_widgetredir.py
[edit]
[-] test_hyperparser.pyc
[edit]
[-] test_autoexpand.pyo
[edit]
[-] test_config_name.pyc
[edit]
[-] test_autocomplete.pyc
[edit]
[-] test_parenmatch.pyc
[edit]
[-] test_rstrip.pyo
[edit]
[-] mock_idle.py
[edit]
[-] test_text.py
[edit]
[-] test_grep.py
[edit]
[-] test_searchdialogbase.py
[edit]
[-] test_configdialog.py
[edit]
[-] mock_tk.py
[edit]
[-] test_textview.pyc
[edit]