PATH: //opt/alt/python27/lib64/python2.7/idlelib/idle_test
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 README.txt
↓
X
📄 __init__.py
↓
X
📄 __init__.pyc
↓
X
📄 __init__.pyo
↓
X
📄 htest.py
↓
X
📄 htest.pyc
↓
X
📄 htest.pyo
↓
X
📄 mock_idle.py
↓
X
📄 mock_idle.pyc
↓
X
📄 mock_idle.pyo
↓
X
📄 mock_tk.py
↓
X
📄 mock_tk.pyc
↓
X
📄 mock_tk.pyo
↓
X
📄 test_autocomplete.py
↓
X
📄 test_autocomplete.pyc
↓
X
📄 test_autocomplete.pyo
↓
X
📄 test_autoexpand.py
↓
X
📄 test_autoexpand.pyc
↓
X
📄 test_autoexpand.pyo
↓
X
📄 test_calltips.py
↓
X
📄 test_calltips.pyc
↓
X
📄 test_calltips.pyo
↓
X
📄 test_config_name.py
↓
X
📄 test_config_name.pyc
↓
X
📄 test_config_name.pyo
↓
X
📄 test_configdialog.py
↓
X
📄 test_configdialog.pyc
↓
X
📄 test_configdialog.pyo
↓
X
📄 test_delegator.py
↓
X
📄 test_delegator.pyc
↓
X
📄 test_delegator.pyo
↓
X
📄 test_editmenu.py
↓
X
📄 test_editmenu.pyc
↓
X
📄 test_editmenu.pyo
↓
X
📄 test_formatparagraph.py
↓
X
📄 test_formatparagraph.pyc
↓
X
📄 test_formatparagraph.pyo
↓
X
📄 test_grep.py
↓
X
📄 test_grep.pyc
↓
X
📄 test_grep.pyo
↓
X
📄 test_helpabout.py
↓
X
📄 test_helpabout.pyc
↓
X
📄 test_helpabout.pyo
↓
X
📄 test_hyperparser.py
↓
X
📄 test_hyperparser.pyc
↓
X
📄 test_hyperparser.pyo
↓
X
📄 test_idlehistory.py
↓
X
📄 test_idlehistory.pyc
↓
X
📄 test_idlehistory.pyo
↓
X
📄 test_io.py
↓
X
📄 test_io.pyc
↓
X
📄 test_io.pyo
↓
X
📄 test_parenmatch.py
↓
X
📄 test_parenmatch.pyc
↓
X
📄 test_parenmatch.pyo
↓
X
📄 test_pathbrowser.py
↓
X
📄 test_pathbrowser.pyc
↓
X
📄 test_pathbrowser.pyo
↓
X
📄 test_rstrip.py
↓
X
📄 test_rstrip.pyc
↓
X
📄 test_rstrip.pyo
↓
X
📄 test_searchdialogbase.py
↓
X
📄 test_searchdialogbase.pyc
↓
X
📄 test_searchdialogbase.pyo
↓
X
📄 test_searchengine.py
↓
X
📄 test_searchengine.pyc
↓
X
📄 test_searchengine.pyo
↓
X
📄 test_text.py
↓
X
📄 test_text.pyc
↓
X
📄 test_text.pyo
↓
X
📄 test_textview.py
↓
X
📄 test_textview.pyc
↓
X
📄 test_textview.pyo
↓
X
📄 test_warning.py
↓
X
📄 test_warning.pyc
↓
X
📄 test_warning.pyo
↓
X
📄 test_widgetredir.py
↓
X
📄 test_widgetredir.pyc
↓
X
📄 test_widgetredir.pyo
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: test_textview.py
'''Test the functions and main class method of textView.py.''' import unittest import os from test.test_support import requires from Tkinter import Tk from idlelib import textView as tv from idlelib.idle_test.mock_idle import Func from idlelib.idle_test.mock_tk import Mbox class TV(tv.TextViewer): # Use in TextViewTest transient = Func() grab_set = Func() wait_window = Func() class textviewClassTest(unittest.TestCase): @classmethod def setUpClass(cls): requires('gui') cls.root = Tk() cls.root.withdraw() @classmethod def tearDownClass(cls): cls.root.destroy() del cls.root def setUp(self): TV.transient.__init__() TV.grab_set.__init__() TV.wait_window.__init__() def test_init_modal(self): view = TV(self.root, 'Title', 'test text') self.assertTrue(TV.transient.called) self.assertTrue(TV.grab_set.called) self.assertTrue(TV.wait_window.called) view.Ok() def test_init_nonmodal(self): view = TV(self.root, 'Title', 'test text', modal=False) self.assertFalse(TV.transient.called) self.assertFalse(TV.grab_set.called) self.assertFalse(TV.wait_window.called) view.Ok() def test_ok(self): view = TV(self.root, 'Title', 'test text', modal=False) view.destroy = Func() view.Ok() self.assertTrue(view.destroy.called) del view.destroy # Unmask the real function. view.destroy() class ViewFunctionTest(unittest.TestCase): @classmethod def setUpClass(cls): requires('gui') cls.root = Tk() cls.root.withdraw() cls.orig_mbox = tv.tkMessageBox tv.tkMessageBox = Mbox @classmethod def tearDownClass(cls): cls.root.destroy() del cls.root tv.tkMessageBox = cls.orig_mbox del cls.orig_mbox def test_view_text(self): # If modal True, get tkinter error 'can't invoke "event" command'. view = tv.view_text(self.root, 'Title', 'test text', modal=False) self.assertIsInstance(view, tv.TextViewer) view.Ok() def test_view_file(self): test_dir = os.path.dirname(__file__) testfile = os.path.join(test_dir, 'test_textview.py') view = tv.view_file(self.root, 'Title', testfile, modal=False) self.assertIsInstance(view, tv.TextViewer) self.assertIn('Test', view.textView.get('1.0', '1.end')) view.Ok() # Mock messagebox will be used; view_file will return None. testfile = os.path.join(test_dir, '../notthere.py') view = tv.view_file(self.root, 'Title', testfile, modal=False) self.assertIsNone(view) if __name__ == '__main__': unittest.main(verbosity=2)
SIMPAN PERUBAHAN