Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_cmd.cpython-39.opt-2.pyc

a

��gi�@s�ddlZddlZddlZddlZddlmZGdd�dej�ZGdd�dej�Z	ddd�Z
d	d
�Zedkr�dej
vr~ed
�ndej
vr�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.9/test/test_cmd.py�preloop�szsamplecmdclass.preloopcCstd�dS)NzHello from postlooprrrrr	�postloop�szsamplecmdclass.postloopcGstd�dS)Nz"This is the completedefault methodr)rZignoredrrr	�completedefault�szsamplecmdclass.completedefaultcCstd�dS)Nzcomplete commandrrrrr	�complete_command�szsamplecmdclass.complete_commandcCsdS)Nr)r�srrr	�do_shell�szsamplecmdclass.do_shellcCsh|��}t|�dkr td�dSzdd�|D�}WntyNtd�YdS0t|d|d�dS)N�z*** invalid number of argumentscSsg|]}t|��qSr)�int)�.0�irrr	�
<listcomp>��z)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 addrrrrr	�help_add�szsamplecmdclass.help_addcCsdS�NTr)r�argrrr	�do_exit�szsamplecmdclass.do_exitN)�__name__�
__module__�__qualname__r
rrr
rrrrrrrr	r
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_printcCsdSrrr(rrr	�do_EOF�sz#TestAlternateInput.simplecmd.do_EOFN)r r!r"r*r+rrrr	�	simplecmd�sr,c@seZdZdd�ZdS)zTestAlternateInput.simplecmd2cCstd|jd�dS)Nz*** Unknown syntax: EOFr$Tr&r(rrr	r+�sz$TestAlternateInput.simplecmd2.do_EOFN)r r!r"r+rrrr	�
simplecmd2�sr-cCsBt�d�}t��}|j||d�}d|_|��|�|��d�dS)N�print 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)Nr.r/Fz5(Cmd) test
(Cmd) test2
(Cmd) *** Unknown syntax: EOF
zprint 

z,(Cmd) 
(Cmd) 
(Cmd) *** Unknown syntax: EOF
)	r1r2r-r3r4r5r6r0r'r7rrr	�test_input_reset_at_EOF�s 

�

�z*TestAlternateInput.test_input_reset_at_EOFN)	r r!r"r:�Cmdr,r-r;r<rrrr	r#�s	r#cCs&ddlm}t�||�t�t�dS)Nr)�test_cmd)�testr>rZrun_doctestZrun_unittestr#)�verboser>rrr	�	test_main�srAcCsPt�d�}|jtjtjgddd�}|�d�|��}td�|j	dd|d�dS)	N�tracerr)Z
ignoredirsrB�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)rDrBZtracer�rrrr	�
test_coverage�s
�
rL�__main__z-cz/tmp/cmd.coverz-i)N)r:rFZunittestr1r?rr=rZTestCaser#rArLr �argvr4rrrr	�<module>s3
	




Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists