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_config_name.py
"""Unit tests for idlelib.configSectionNameDialog""" import unittest from idlelib.idle_test.mock_tk import Var, Mbox from idlelib import configSectionNameDialog as name_dialog_module name_dialog = name_dialog_module.GetCfgSectionNameDialog class Dummy_name_dialog(object): # Mock for testing the following methods of name_dialog name_ok = name_dialog.name_ok.im_func Ok = name_dialog.Ok.im_func Cancel = name_dialog.Cancel.im_func # Attributes, constant or variable, needed for tests used_names = ['used'] name = Var() result = None destroyed = False def grab_release(self): pass def destroy(self): self.destroyed = True # name_ok calls Mbox.showerror if name is not ok orig_mbox = name_dialog_module.tkMessageBox showerror = Mbox.showerror class ConfigNameTest(unittest.TestCase): dialog = Dummy_name_dialog() @classmethod def setUpClass(cls): name_dialog_module.tkMessageBox = Mbox @classmethod def tearDownClass(cls): name_dialog_module.tkMessageBox = orig_mbox def test_blank_name(self): self.dialog.name.set(' ') self.assertEqual(self.dialog.name_ok(), '') self.assertEqual(showerror.title, 'Name Error') self.assertIn('No', showerror.message) def test_used_name(self): self.dialog.name.set('used') self.assertEqual(self.dialog.name_ok(), '') self.assertEqual(showerror.title, 'Name Error') self.assertIn('use', showerror.message) def test_long_name(self): self.dialog.name.set('good'*8) self.assertEqual(self.dialog.name_ok(), '') self.assertEqual(showerror.title, 'Name Error') self.assertIn('too long', showerror.message) def test_good_name(self): self.dialog.name.set(' good ') showerror.title = 'No Error' # should not be called self.assertEqual(self.dialog.name_ok(), 'good') self.assertEqual(showerror.title, 'No Error') def test_ok(self): self.dialog.destroyed = False self.dialog.name.set('good') self.dialog.Ok() self.assertEqual(self.dialog.result, 'good') self.assertTrue(self.dialog.destroyed) def test_cancel(self): self.dialog.destroyed = False self.dialog.Cancel() self.assertEqual(self.dialog.result, '') self.assertTrue(self.dialog.destroyed) if __name__ == '__main__': unittest.main(verbosity=2, exit=False)
Save