403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/__pycache__/test_cmd.cpython-315.opt-1.pyc
R
>lqj�$c���Qs]PHs]PHs]PHs]PHs]PHs]PHs]QHGs]QH$G
s
Gs]QH0G
s
QQ\O2sQQ\O 2sQQ	\O2sQ
Q\O 2s\O(2QQ
\O22sQs\Q6Xc<Q\O07c\2O32P!\O42P!P!)z@
Test script for the 'cmd' module
Original by Michael Schneider
)�support)�ensure_lazy_imports�
import_module)�run_ptyc�F`�\sQs]sn\O
Q2sQsUsP!)�LazyImportTestc�$�[QQQ.2P!)�cmd�inspect�string)r��selfs&�"C:\Python315\\Lib\test\test_cmd.py�test_lazy_import�LazyImportTest.test_lazy_imports���E�I�x�#8�9��)	�__name__�
__module__�__qualname__�__firstlineno__r�cpython_onlyr�__static_attributes__�__classdictcell__��
__classdict__s@r
rrs�������:��:rrc�b`�\sQs]snQsQsQsQsQsQs	Qs
QsQ	sQ
s
QsQsUsP!)
�samplecmdclassa;
Instance the sampleclass:
>>> mycmd = samplecmdclass()

Test for the function parseline():
>>> mycmd.parseline("")
(None, None, '')
>>> mycmd.parseline("?")
('help', '', 'help ')
>>> mycmd.parseline("?help")
('help', 'help', 'help help')
>>> mycmd.parseline("!")
('shell', '', 'shell ')
>>> mycmd.parseline("!command")
('shell', 'command', 'shell command')
>>> mycmd.parseline("func")
('func', '', 'func')
>>> mycmd.parseline("func arg1")
('func', 'arg1', 'func arg1')


Test for the function onecmd():
>>> mycmd.onecmd("")
>>> mycmd.onecmd("add 4 5")
9
>>> mycmd.onecmd("")
9
>>> mycmd.onecmd("test")
*** Unknown syntax: test

Test for the function emptyline():
>>> mycmd.emptyline()
*** Unknown syntax: test

Test for the function default():
>>> mycmd.default("default")
*** Unknown syntax: default

Test for the function completedefault():
>>> mycmd.completedefault()
This is the completedefault method
>>> mycmd.completenames("a")
['add']

Test for the function completenames():
>>> mycmd.completenames("12")
[]
>>> mycmd.completenames("help")
['help']

Test for the function complete_help():
>>> mycmd.complete_help("a")
['add']
>>> mycmd.complete_help("he")
['help']
>>> mycmd.complete_help("12")
[]
>>> sorted(mycmd.complete_help(""))
['add', 'exit', 'help', 'life', 'meaning', 'shell']

Test for the function do_help():
>>> mycmd.do_help("testet")
*** No help on testet
>>> mycmd.do_help("add")
help text for add
>>> mycmd.onecmd("help add")
help text for add
>>> mycmd.onecmd("help meaning")  # doctest: +NORMALIZE_WHITESPACE
Try and be nice to people, avoid eating fat, read a good book every
now and then, get some walking in, and try to live together in peace
and harmony with people of all creeds and nations.
>>> mycmd.do_help("")
<BLANKLINE>
Documented commands (type help <topic>):
========================================
add  help
<BLANKLINE>
Miscellaneous help topics:
==========================
life  meaning
<BLANKLINE>
Undocumented commands:
======================
exit  shell
<BLANKLINE>

Test for the function print_topics():
>>> mycmd.print_topics("header", ["command1", "command2"], 2 ,10)
header
======
command1
command2
<BLANKLINE>

Test for the function columnize():
>>> mycmd.columnize([str(i) for i in range(20)])
0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19
>>> mycmd.columnize([str(i) for i in range(20)], 10)
0  7   14
1  8   15
2  9   16
3  10  17
4  11  18
5  12  19
6  13

This is an interactive test, put some commands in the cmdqueue attribute
and let it execute
This test includes the preloop(), postloop(), default(), emptyline(),
parseline(), do_help() functions
>>> mycmd.use_rawinput=0

>>> mycmd.cmdqueue=["add", "add 4 5", "", "help", "help add", "exit"]
>>> mycmd.cmdloop()  # doctest: +REPORT_NDIFF
Hello from preloop
*** invalid number of arguments
9
9
<BLANKLINE>
Documented commands (type help <topic>):
========================================
add  help
<BLANKLINE>
Miscellaneous help topics:
==========================
life  meaning
<BLANKLINE>
Undocumented commands:
======================
exit  shell
<BLANKLINE>
help text for add
Hello from postloop
c��[Q2P!)zHello from preloop��printrs&r
�preloop�samplecmdclass.preloop�s��
�"�#rc��[Q2P!)zHello from postlooprrs&r
�postloop�samplecmdclass.postloop�s��
�#�$rc��[Q2P!)z"This is the completedefault methodr)r�ignoreds&*r
�completedefault�samplecmdclass.completedefault�s��
�2�3rc��[Q2P!)zcomplete commandrrs&r
�complete_command�samplecmdclass.complete_command�s��
� �!rc��P!�Nr)r�ss&&r
�do_shell�samplecmdclass.do_shell�s��rc��UO2o[U2]6wc[Q2P!STt,tFDo[U2MJ	oo[U]*U]**2P!ttoh[c[Q2P!h9h)�z*** invalid number of argumentsz*** arguments should be numbers)�split�lenr�int�
ValueError)rr.�l�is&&  r
�do_add�samplecmdclass.do_add�sw��
�G�G�I���q�6�Q�;��3�4��	�!"�#��A��Q���A�#�	�a��d�1�Q�4�i���	$���	��3�4��	�s(�A2�A-�	A2�-A2�2	B�<B�Bc��[Q2P!)zhelp text for addrrs&r
�help_add�samplecmdclass.help_add�s��
�!�"�rc��[Q2P!)z�Try and be nice to people, avoid eating fat, read a good book every now and then, get some walking in, and try to live together in peace and harmony with people of all creeds and nations.rrs&r
�help_meaning�samplecmdclass.help_meaning�s��
�2�	3�	rc��[Q2P!)z&Always look on the bright side of liferrs&r
�	help_life�samplecmdclass.help_life�s��
�6�7�rc��P	!�Tr)r�args&&r
�do_exit�samplecmdclass.do_exit�s��rr)rrrr�__doc__r r#r'r*r/r9r<r?rBrGrrrs@r
rrsC����E�N$�%�4�"�
�
�����rrc�n`�\sQs]�snQQ\O
2sQQ\2sQsQs	Qs
UsP!)�TestAlternateInputc�.`�\sQs]�snQsQsQsUsP!)�TestAlternateInput.simplecmdc�4�[VOQ5P!)��file�r�stdout�r�argss&&r
�do_print�%TestAlternateInput.simplecmd.do_print�s���$�[�[�)rc��P	!rErrSs&&r
�do_EOF�#TestAlternateInput.simplecmd.do_EOF�s��rr)rrrrrUrXrrrs@r
�	simplecmdrM�s����	*�	�	rrZc�(`�\sQs]�snQsQsUsP!)�TestAlternateInput.simplecmd2c�6�[QUOQ5P	!)z*** Unknown syntax: EOFrOrQrSs&&r
rX�$TestAlternateInput.simplecmd2.do_EOF�s���+�$�+�+�>�rr)rrrrrXrrrs@r
�
simplecmd2r\�s����	�	rr_c���[OQ2o[O2oUOVQ5oP
UmUO2UOUO
2Q2P!)�print test
print test2��stdinrRz(Cmd) test
(Cmd) test2
(Cmd) )�io�StringIOrZ�use_rawinput�cmdloop�assertMultiLineEqual�getvalue�r�input�outputrs&   r
�test_file_with_missing_final_nl�2TestAlternateInput.test_file_with_missing_final_nl�sY�����5�6��������n�n�5�n�8�� ������
��!�!�&�/�/�"3��	rc���[OQ2o[O2oUOVQ5oP
UmUO2UOUO
2Q2[OQ2o[O2oVmV#mUO2UOUO
2Q2P!)rarbz5(Cmd) test
(Cmd) test2
(Cmd) *** Unknown syntax: EOF
zprint 

z,(Cmd) 
(Cmd) 
(Cmd) *** Unknown syntax: EOF
)	rdrer_rfrgrhrircrRrjs&   r
�test_input_reset_at_EOF�*TestAlternateInput.test_input_reset_at_EOF�s������5�6��������o�o�E�o�9�� ������
��!�!�&�/�/�"3�/�	1����L�)��������	��
����
��!�!�&�/�/�"3�/�	1rr)rrrrr�CmdrZr_rmrprrrs@r
rKrK�s0�����C�G�G���Y��	�1�1rrKc�,`�\sQsQsnQsQsQsUsP!)�CmdPrintExceptionClass�z�
GH-80731
cmd.Cmd should print the correct exception in default()
>>> mycmd = CmdPrintExceptionClass()
>>> try:
...     raise ValueError("test")
... except ValueError:
...     mycmd.onecmd("not important")
(<class 'ValueError'>, ValueError('test'))
c�R�[[O2Q*2P!):Nr2N)r�sys�exc_info)r�lines&&r
�default�CmdPrintExceptionClass.defaults��
�c�l�l�n�R� �!rr)rrrrrIrzrrrs@r
rtrts����	�"�"rrtc�4`�\sQsQsnQsQsQsQsUsP!)�CmdTestReadline�c��[Q2oP!��readline)rr�s r
�
setUpClass�CmdTestReadline.setUpClasss��!��,�rc��[OQ2oQo[V2oUOQU2UOQU2P!)z�
            import cmd
            class simplecmd(cmd.Cmd):
                def do_tab_completion_test(self, args):
                    print('tab completion success')
                    return True

            simplecmd().cmdloop()
        st	
sab_completion_test�tab completion success)�textwrap�dedentr�assertIn�r�scriptrkrls&   r
�test_basic_completion�%CmdTestReadline.test_basic_completionsD�����"�
������'���
�
�+�V�4��
�
�/��8rc	��[OQ2oQFDUoUOUQ59^tt^2[V2oUO	QU2UO	QU2PPP2JW	P!)%fhJl9h)a�
            import cmd
            class simplecmd(cmd.Cmd):
                def completedefault(self, text, line, begidx, endidx):
                    return ["hello"]

                def default(self, line):
                    if line.replace(" ", "") == "!hello":
                        print('tab completion success')
                    else:
                        print('tab completion failure')
                    return True

            simplecmd().cmdloop()
        )rkshellor�)s! h	
s!h	
)r�r��subTestrr�r�s&   r
�%test_bang_completion_without_do_shell�5CmdTestReadline.test_bang_completion_without_do_shell*sk�����"�
��"-�E����E��*�*� ��/���
�
�h��/��
�
�7��@�+�*�-�*�*�*�s�0A6	�6B
�?B
r)	rrrrr�r�r�rrrs@r
r}r}s����-�
9�&A�Arr}c�P�UO[O22U!r-)�addTest�doctest�DocTestSuite)�loader�tests�patterns&&&r
�
load_testsr�Bs��	�M�M�'�&�&�(�)��Lr�__main__z-i)rIrrwr��unittestrdr��testr�test.support.import_helperrr�test.support.pty_helperr�TestCaserrrrrKrt�requires_subprocessr}r�r�argvrg�mainrrr
�<module>r�s�����
���	���I�+�:�X�&�&�:�s�S�W�W�s�l01��*�*�01�f
"�S�W�W�
"� 	����/A�h�'�'�/A��/A�b�
�z���s�x�x���� � �"��
�
��	r

Youez - 2016 - github.com/yon3zu
LinuXploit