| Server IP : 118.27.122.248 / Your IP : 216.73.216.240 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python36/lib64/python3.6/test/__pycache__/ |
Upload File : |
3
x2_X � @ s| d dl Z d dlmZ d dlZd dlZd dlZejd�Zejj ejj
e�dddd�ZdZ
G dd � d e j�Zed
krxe j� dS )� N)�supportz symbol.pyz..ZIncludez
graminit.hzsymbol_test.pyc @ sB e Zd Zdd� Zdd� Zdd� Zejej j
e� d�dd � �Zd
S )�TestSymbolGenerationc C sj t |��}|j� }W d Q R X t |d��:}|j|d |jd�d � � |j||jd�d � � W d Q R X d S )N�wz#--start constants--
� z#--end constants--
)�open� readlines�
writelines�index)�selfZsource_fileZ dest_file�fp�lines� r
�5/opt/alt/python36/lib64/python3.6/test/test_symbol.py�$_copy_file_without_generated_symbols s
z9TestSymbolGeneration._copy_file_without_generated_symbolsc C s0 t jtjt||gt jd�}|j� d }|j|fS )N)�stderrr )�
subprocess�Popen�sys�
executable�SYMBOL_FILE�PIPEZcommunicate�
returncode)r
Zgrammar_fileZtarget_symbol_py_file�procr r
r
r �_generate_symbols s z&TestSymbolGeneration._generate_symbolsc C sH t |��}|j� }W d Q R X t |��}|j� }W d Q R X | j||� d S )N)r r �assertEqual)r
Zfile1Zfile2r Zlines1Zlines2r
r
r �
compare_files s
z"TestSymbolGeneration.compare_filesz+test only works from source build directoryc C sX t j}| jt j|� | jt|� | jt|�\}}| jd|� | jd|� | j t|� d S )N� r )
r ZTESTFNZ
addCleanup�unlinkr r r �GRAMMAR_FILEr r )r
�outputZexitcoder r
r
r �!test_real_grammar_and_symbol_file&