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.10/test/__pycache__/test_pstats.cpython-310.pyc
o

�i=
�@sxddlZddlmZddlmZddlmZddlZddlZGdd�dej�Z	Gdd�dej�Z
ed	kr:e��dSdS)
�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�-/usr/local/lib/python3.10/test/test_pstats.py�test_combine_results
s

z'AddCallersTestCase.test_combine_resultsN)�__name__�
__module__�__qualname__�__doc__rrrrrr
src@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�
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]\}}|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-)�f�fiZfil�fileZfilenZfilenaZfilenamr-r'r1)rZsortkeyr2rrr�test_sort_stats_partial8s
��z%StatsTestCase.test_sort_stats_partialcCs0|�t|jjdtj�|�t|jjtjd�dS)Nr$)ZassertRaises�	TypeErrorrr)rZTIME�rrrr�test_sort_starts_mix@s��z"StatsTestCase.test_sort_starts_mixcCs�dd�}dd�}dd�}t��}|��|�|�|�|��t�|�}|��}t|j�	��}|�
d|�|�
d|�|�
d	|�dS)
NcS�dS�Nrrrrr�pass1I�z3StatsTestCase.test_get_stats_profile.<locals>.pass1cSr;r<rrrrr�pass2Jr>z3StatsTestCase.test_get_stats_profile.<locals>.pass2cSr;r<rrrrr�pass3Kr>z3StatsTestCase.test_get_stats_profile.<locals>.pass3r=r?r@)�cProfileZProfile�enableZcreate_statsrrZget_stats_profile�setZ
func_profiles�keysZassertIn)rr=r?r@ZprZpsZ
stats_profileZfuncs_calledrrr�test_get_stats_profileHs
z$StatsTestCase.test_get_stats_profilecCs"|�tjd�|�tjtj�dS)Nr-)rrZFILENAMEZassertNotEqualZCALLSr9rrr�test_SortKey_enum[szStatsTestCase.test_SortKey_enumN)rrrrr"r,r3r7r:rErFrrrrrs
r�__main__)
Zunittest�testr�iorrrrAZTestCaserrr�mainrrrr�<module>sC�