Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/test_symbol.cpython-38.pyc
U

>��g<�@s�ddlZddlmZddlZddlZddlZddlZe�d�Zej	�
ej	�e�ddddd�Z
ej	�
ej	�e�dddd	�Zd
ZGdd�dej�Zed
kr�e��dS)�N)�supportz	symbol.pyz..ZToolsZscriptszgenerate_symbol_py.pyZIncludez
graminit.hzsymbol_test.pyc@s<eZdZdd�Zdd�Zdd�Ze�e�	�d�dd	��Z
d
S)�TestSymbolGenerationc	Csjt|��}|��}W5QRXt|d��:}|�|d|�d�d��|�||�d�d��W5QRXdS)N�wz#--start constants--
�z#--end constants--
)�open�	readlines�
writelines�index)�selfZsource_fileZ	dest_file�fp�lines�r
�//opt/cppython/lib/python3.8/test/test_symbol.py�$_copy_file_without_generated_symbolss

z9TestSymbolGeneration._copy_file_without_generated_symbolscCs0tjtjt||gtjd�}|��d}|j|fS)N)�stderrr)�
subprocess�Popen�sys�
executable�GEN_SYMBOL_FILE�PIPE�communicate�
returncode)r
Zgrammar_fileZtarget_symbol_py_file�procrr
r
r�_generate_symbolss��z&TestSymbolGeneration._generate_symbolsc	CsHt|��}|��}W5QRXt|��}|��}W5QRX|�||�dS)N)rr�assertEqual)r
Zfile1Zfile2rZlines1Zlines2r
r
r�
compare_files#s


z"TestSymbolGeneration.compare_filesz+test only works from source build directorycCsXtj}|�tj|�|�t|�|�t|�\}}|�d|�|�d|�|�	t|�dS)N�r)
rZTESTFNZ
addCleanup�unlinkr�SYMBOL_FILEr�GRAMMAR_FILErr)r
�output�exitcoderr
r
r�!test_real_grammar_and_symbol_file*sz6TestSymbolGeneration.test_real_grammar_and_symbol_fileN)�__name__�
__module__�__qualname__rrr�unittestZ
skipUnless�	sysconfigZis_python_buildr#r
r
r
rrs
�r�__main__)r'�testr�osrr(rZfindfiler�path�join�dirname�__file__rr ZTEST_PY_FILEZTestCaserr$�mainr
r
r
r�<module>s.
��'

F1le Man4ger