!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/opt/alt/python35/lib64/python3.5/idlelib/idle_test/   drwxr-xr-x
Free 232.98 GB of 981.82 GB (23.73%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_config_name.py (2.34 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
"""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:
    # Mock for testing the following methods of name_dialog
    name_ok = name_dialog.name_ok
    Ok = name_dialog.Ok
    Cancel = name_dialog.Cancel
    # Attributes, constant or variable, needed for tests
    used_names = ['used']
    name = Var()
    result = None
    destroyed = False
    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)

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0112 ]--