HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_cmd.cpython-37.opt-2.pyc
B

��gi�@s�ddlZddlZddlZddlZddlmZGdd�dej�ZGdd�dej�Z	ddd�Z
d	d
�Zedkr�dej
kr~ed
�ndej
kr�e���ne
�dS)�N)�supportc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�samplecmdclasscCstd�dS)NzHello from preloop)�print)�self�r�)/usr/local/lib/python3.7/test/test_cmd.py�preloop�szsamplecmdclass.preloopcCstd�dS)NzHello from postloop)r)rrrr�postloop�szsamplecmdclass.postloopcGstd�dS)Nz"This is the completedefault method)r)rZignoredrrr�completedefault�szsamplecmdclass.completedefaultcCstd�dS)Nzcomplete command)r)rrrr�complete_command�szsamplecmdclass.complete_commandcCsdS)Nr)r�srrr�do_shell�szsamplecmdclass.do_shellcCsh|��}t|�dkr td�dSydd�|D�}Wntk
rNtd�dSXt|d|d�dS)N�z*** invalid number of argumentscSsg|]}t|��qSr)�int)�.0�irrr�
<listcomp>�sz)samplecmdclass.do_add.<locals>.<listcomp>z*** arguments should be numbersr�)�split�lenr�
ValueError)rr�lrrr�do_add�szsamplecmdclass.do_addcCstd�dS)Nzhelp text for add)r)rrrr�help_add�szsamplecmdclass.help_addcCsdS)NTr)r�argrrr�do_exit�szsamplecmdclass.do_exitN)�__name__�
__module__�__qualname__rr	r
rr
rrrrrrrr
s{rc@s>eZdZGdd�dej�ZGdd�de�Zdd�Zdd�Zd	S)
�TestAlternateInputc@seZdZdd�Zdd�ZdS)zTestAlternateInput.simplecmdcCst||jd�dS)N)�file)r�stdout)r�argsrrr�do_print�sz%TestAlternateInput.simplecmd.do_printcCsdS)NTr)rr"rrr�do_EOF�sz#TestAlternateInput.simplecmd.do_EOFN)rrrr#r$rrrr�	simplecmd�sr%c@seZdZdd�ZdS)zTestAlternateInput.simplecmd2cCstd|jd�dS)Nz*** Unknown syntax: EOF)r T)rr!)rr"rrrr$�sz$TestAlternateInput.simplecmd2.do_EOFN)rrrr$rrrr�
simplecmd2�sr&cCsBt�d�}t��}|j||d�}d|_|��|�|��d�dS)Nzprint test
print test2)�stdinr!Fz(Cmd) test
(Cmd) test2
(Cmd) )�io�StringIOr%�use_rawinput�cmdloop�assertMultiLineEqual�getvalue)r�input�output�cmdrrr�test_file_with_missing_final_nl�s

z2TestAlternateInput.test_file_with_missing_final_nlcCsxt�d�}t��}|j||d�}d|_|��|�|��d�t�d�}t��}||_||_|��|�|��d�dS)Nzprint test
print test2)r'r!Fz5(Cmd) test
(Cmd) test2
(Cmd) *** Unknown syntax: EOF
zprint 

z,(Cmd) 
(Cmd) 
(Cmd) *** Unknown syntax: EOF
)	r(r)r&r*r+r,r-r'r!)rr.r/r0rrr�test_input_reset_at_EOF�s



z*TestAlternateInput.test_input_reset_at_EOFN)	rrrr0�Cmdr%r&r1r2rrrrr�s	rcCs&ddlm}t�||�t�t�dS)Nr)�test_cmd)�testr4rZrun_doctestZrun_unittestr)�verboser4rrr�	test_main�sr7cCsPt�d�}|jtjtjgddd�}|�d�|��}td�|j	dd|d�dS)	N�tracerr)Z
ignoredirsr8�countz4import importlib; importlib.reload(cmd); test_main()zWriting coverage results...T)Zshow_missingZsummary�coverdir)
r�
import_moduleZTrace�sys�base_prefix�base_exec_prefix�run�resultsrZ
write_results)r:r8Ztracer�rrrr�
test_coverage�s


rB�__main__z-cz/tmp/cmd.coverz-i)N)r0r<Zunittestr(r5rr3rZTestCaserr7rBr�argvr+rrrr�<module>s3