Your IP : 216.73.216.52


Current Path : /opt/alt/python39/lib64/python3.9/test/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/test/__pycache__/test_pstats.cpython-39.opt-1.pyc

a

XC?h;�@stddlZddlmZddlmZddlmZddlZddlZGdd�dej�Z	Gdd�dej�Z
ed	krpe��dS)
�N)�support)�StringIO)�SortKeyc@seZdZdZdd�ZdS)�AddCallersTestCasez$Tests for pstats.add_callers helper.cCsdddi}ddd�}t�||�}|�|ddd��ddi}ddd�}t�||�}|�|ddd��dS)	N�a)����)����)r�b)rr
rrrrr)�pstatsZadd_callers�assertEqual)�self�target�sourceZnew_callers�r�5/opt/alt/python39/lib64/python3.9/test/test_pstats.py�test_combine_results
s

z'AddCallersTestCase.test_combine_resultsN)�__name__�
__module__�__qualname__�__doc__rrrrrr
src@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�
StatsTestCasecCst�d�}t�|�|_dS)Nz
pstats.pck)rZfindfiler�Stats�stats)rZ
stats_filerrr�setUps
zStatsTestCase.setUpcCs&t�}tj|d�}|�|j|j�dS)N)�stream)rrr�addr)rr rrrr�test_add!szStatsTestCase.test_addcCsLddddd�}|��D]0\}}|j�|�|�|jj|jj|d�qdS)N�stdname�calls�time�
cumulative)���rrrr')�itemsr�
sort_statsr�	sort_type�sort_arg_dict_default)rZ
valid_argsZarg_intZarg_strrrr�test_sort_stats_int&s�
�z!StatsTestCase.test_sort_stats_intcCs6dD],}|j�|�|�|jj|jj|d�qdS)N)
r$ZncallsZcumtimer&�filename�line�module�nameZnflZpcallsr#r%Ztottimer'�rr)rr*r+)r�	sort_namerrr�test_sort_stats_string0s

�z$StatsTestCase.test_sort_stats_stringcCs:d}dD],}|j�|�|�|jj|jj|d�qdS)Nr-)�fZfiZfil�fileZfilenZfilenaZfilenamr-r'r1)rZsortkeyr2rrr�test_sort_stats_partial8s
�z%StatsTestCase.test_sort_stats_partialcCs8tD].}|j�|�|�|jj|jj|jd�qdS)Nr')rrr)rr*r+�value)r�memberrrr�test_sort_stats_enum@s�z"StatsTestCase.test_sort_stats_enumcCs0|�t|jjdtj�|�t|jjtjd�dS)Nr$)ZassertRaises�	TypeErrorrr)rZTIME�rrrr�test_sort_starts_mixGs��z"StatsTestCase.test_sort_starts_mixcCs�dd�}dd�}dd�}t��}|��|�|�|�|��t�|�}|��}t|j�	��}|�
d|�|�
d|�|�
d	|�dS)
NcSsdS�Nrrrrr�pass1P�z3StatsTestCase.test_get_stats_profile.<locals>.pass1cSsdSr=rrrrr�pass2Qr?z3StatsTestCase.test_get_stats_profile.<locals>.pass2cSsdSr=rrrrr�pass3Rr?z3StatsTestCase.test_get_stats_profile.<locals>.pass3r>r@rA)�cProfileZProfileZenableZcreate_statsrrZget_stats_profile�setZ
func_profiles�keysZassertIn)rr>r@rAZprZpsZ
stats_profileZfuncs_calledrrr�test_get_stats_profileOs
z$StatsTestCase.test_get_stats_profilecCs"|�tjd�|�tjtj�dS)Nr-)rrZFILENAMEZassertNotEqualZCALLSr;rrr�test_SortKey_enumbszStatsTestCase.test_SortKey_enumN)rrrrr"r,r3r6r9r<rErFrrrrrs
r�__main__)
Zunittest�testr�iorrrrBZTestCaserrr�mainrrrr�<module>sJ