golden hour
/opt/alt/python27/lib64/python2.7/idlelib/idle_test
⬆️ Go Up
Upload
File/Folder
Size
Actions
README.txt
5.36 KB
Del
OK
__init__.py
650 B
Del
OK
__init__.pyc
941 B
Del
OK
__init__.pyo
941 B
Del
OK
htest.py
13.46 KB
Del
OK
htest.pyc
12.36 KB
Del
OK
htest.pyo
12.36 KB
Del
OK
mock_idle.py
1.56 KB
Del
OK
mock_idle.pyc
2.94 KB
Del
OK
mock_idle.pyo
2.94 KB
Del
OK
mock_tk.py
11.3 KB
Del
OK
mock_tk.pyc
12.42 KB
Del
OK
mock_tk.pyo
12.42 KB
Del
OK
test_autocomplete.py
4.81 KB
Del
OK
test_autocomplete.pyc
5.98 KB
Del
OK
test_autocomplete.pyo
5.98 KB
Del
OK
test_autoexpand.py
4.03 KB
Del
OK
test_autoexpand.pyc
4.85 KB
Del
OK
test_autoexpand.pyo
4.85 KB
Del
OK
test_calltips.py
6.97 KB
Del
OK
test_calltips.pyc
12.47 KB
Del
OK
test_calltips.pyo
12.47 KB
Del
OK
test_config_name.py
2.41 KB
Del
OK
test_config_name.pyc
4.08 KB
Del
OK
test_config_name.pyo
4.08 KB
Del
OK
test_configdialog.py
782 B
Del
OK
test_configdialog.pyc
1.68 KB
Del
OK
test_configdialog.pyo
1.68 KB
Del
OK
test_delegator.py
1.26 KB
Del
OK
test_delegator.pyc
1.33 KB
Del
OK
test_delegator.pyo
1.33 KB
Del
OK
test_editmenu.py
3.09 KB
Del
OK
test_editmenu.pyc
4.46 KB
Del
OK
test_editmenu.pyo
4.46 KB
Del
OK
test_formatparagraph.py
14.01 KB
Del
OK
test_formatparagraph.pyc
14.36 KB
Del
OK
test_formatparagraph.pyo
14.36 KB
Del
OK
test_grep.py
2.7 KB
Del
OK
test_grep.pyc
3.81 KB
Del
OK
test_grep.pyo
3.81 KB
Del
OK
test_helpabout.py
1.57 KB
Del
OK
test_helpabout.pyc
2.38 KB
Del
OK
test_helpabout.pyo
2.38 KB
Del
OK
test_hyperparser.py
5.55 KB
Del
OK
test_hyperparser.pyc
6.78 KB
Del
OK
test_hyperparser.pyo
6.78 KB
Del
OK
test_idlehistory.py
5.37 KB
Del
OK
test_idlehistory.pyc
8.28 KB
Del
OK
test_idlehistory.pyo
8.28 KB
Del
OK
test_io.py
9.28 KB
Del
OK
test_io.pyc
11.67 KB
Del
OK
test_io.pyo
11.67 KB
Del
OK
test_parenmatch.py
3.73 KB
Del
OK
test_parenmatch.pyc
5.53 KB
Del
OK
test_parenmatch.pyo
5.53 KB
Del
OK
test_pathbrowser.py
940 B
Del
OK
test_pathbrowser.pyc
1.5 KB
Del
OK
test_pathbrowser.pyo
1.5 KB
Del
OK
test_rstrip.py
1.58 KB
Del
OK
test_rstrip.pyc
1.78 KB
Del
OK
test_rstrip.pyo
1.78 KB
Del
OK
test_searchdialogbase.py
5.73 KB
Del
OK
test_searchdialogbase.pyc
6.87 KB
Del
OK
test_searchdialogbase.pyo
6.87 KB
Del
OK
test_searchengine.py
11.22 KB
Del
OK
test_searchengine.pyc
12.81 KB
Del
OK
test_searchengine.pyo
12.81 KB
Del
OK
test_text.py
6.59 KB
Del
OK
test_text.pyc
8.2 KB
Del
OK
test_text.pyo
8.2 KB
Del
OK
test_textview.py
2.74 KB
Del
OK
test_textview.pyc
4.6 KB
Del
OK
test_textview.pyo
4.6 KB
Del
OK
test_warning.py
2.69 KB
Del
OK
test_warning.pyc
3.31 KB
Del
OK
test_warning.pyo
3.31 KB
Del
OK
test_widgetredir.py
4.08 KB
Del
OK
test_widgetredir.pyc
6.49 KB
Del
OK
test_widgetredir.pyo
6.49 KB
Del
OK
Edit: test_rstrip.py
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