/
opt
/
alt
/
python27
/
lib64
/
python2.7
/
idlelib
/
idle_test
/
/opt/alt/python27/lib64/python2.7/idlelib/idle_test
mkdir
upload
Name
Size
Mode
Actions
htest.py
13779
0644
edit
dl
rm
htest.pyc
12652
0644
edit
dl
rm
htest.pyo
12652
0644
edit
dl
rm
mock_idle.py
1597
0644
edit
dl
rm
mock_idle.pyc
3009
0644
edit
dl
rm
mock_idle.pyo
3009
0644
edit
dl
rm
mock_tk.py
11574
0644
edit
dl
rm
mock_tk.pyc
12713
0644
edit
dl
rm
mock_tk.pyo
12713
0644
edit
dl
rm
README.txt
5492
0644
edit
dl
rm
test_autocomplete.py
4922
0644
edit
dl
rm
test_autocomplete.pyc
6120
0644
edit
dl
rm
test_autocomplete.pyo
6120
0644
edit
dl
rm
test_autoexpand.py
4122
0644
edit
dl
rm
test_autoexpand.pyc
4962
0644
edit
dl
rm
test_autoexpand.pyo
4962
0644
edit
dl
rm
test_calltips.py
7140
0644
edit
dl
rm
test_calltips.pyc
12768
0644
edit
dl
rm
test_calltips.pyo
12768
0644
edit
dl
rm
test_configdialog.py
782
0644
edit
dl
rm
test_configdialog.pyc
1720
0644
edit
dl
rm
test_configdialog.pyo
1720
0644
edit
dl
rm
test_config_name.py
2472
0644
edit
dl
rm
test_config_name.pyc
4181
0644
edit
dl
rm
test_config_name.pyo
4181
0644
edit
dl
rm
test_delegator.py
1294
0644
edit
dl
rm
test_delegator.pyc
1358
0644
edit
dl
rm
test_delegator.pyo
1358
0644
edit
dl
rm
test_editmenu.py
3167
0644
edit
dl
rm
test_editmenu.pyc
4569
0644
edit
dl
rm
test_editmenu.pyo
4569
0644
edit
dl
rm
test_formatparagraph.py
14344
0644
edit
dl
rm
test_formatparagraph.pyc
14708
0644
edit
dl
rm
test_formatparagraph.pyo
14708
0644
edit
dl
rm
test_grep.py
2762
0644
edit
dl
rm
test_grep.pyc
3903
0644
edit
dl
rm
test_grep.pyo
3903
0644
edit
dl
rm
test_helpabout.py
1611
0644
edit
dl
rm
test_helpabout.pyc
2441
0644
edit
dl
rm
test_helpabout.pyo
2441
0644
edit
dl
rm
test_hyperparser.py
5684
0644
edit
dl
rm
test_hyperparser.pyc
6942
0644
edit
dl
rm
test_hyperparser.pyo
6942
0644
edit
dl
rm
test_idlehistory.py
5495
0644
edit
dl
rm
test_idlehistory.pyc
8480
0644
edit
dl
rm
test_idlehistory.pyo
8480
0644
edit
dl
rm
test_io.py
9505
0644
edit
dl
rm
test_io.pyc
11949
0644
edit
dl
rm
test_io.pyo
11949
0644
edit
dl
rm
test_parenmatch.py
3822
0644
edit
dl
rm
test_parenmatch.pyc
5664
0644
edit
dl
rm
test_parenmatch.pyo
5664
0644
edit
dl
rm
test_pathbrowser.py
940
0644
edit
dl
rm
test_pathbrowser.pyc
1537
0644
edit
dl
rm
test_pathbrowser.pyo
1537
0644
edit
dl
rm
test_rstrip.py
1613
0644
edit
dl
rm
test_rstrip.pyc
1825
0644
edit
dl
rm
test_rstrip.pyo
1825
0644
edit
dl
rm
test_searchdialogbase.py
5863
0644
edit
dl
rm
test_searchdialogbase.pyc
7035
0644
edit
dl
rm
test_searchdialogbase.pyo
7035
0644
edit
dl
rm
test_searchengine.py
11487
0644
edit
dl
rm
test_searchengine.pyc
13117
0644
edit
dl
rm
test_searchengine.pyo
13117
0644
edit
dl
rm
test_text.py
6744
0644
edit
dl
rm
test_text.pyc
8395
0644
edit
dl
rm
test_text.pyo
8395
0644
edit
dl
rm
test_textview.py
2802
0644
edit
dl
rm
test_textview.pyc
4713
0644
edit
dl
rm
test_textview.pyo
4713
0644
edit
dl
rm
test_warning.py
2757
0644
edit
dl
rm
test_warning.pyc
3390
0644
edit
dl
rm
test_warning.pyo
3390
0644
edit
dl
rm
test_widgetredir.py
4177
0644
edit
dl
rm
test_widgetredir.pyc
6644
0644
edit
dl
rm
test_widgetredir.pyo
6644
0644
edit
dl
rm
__init__.py
650
0644
edit
dl
rm
__init__.pyc
941
0644
edit
dl
rm
__init__.pyo
941
0644
edit
dl
rm
Edit:
/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_rstrip.py
(1613B)
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)
Save
cmd:
run