| Server IP : 118.27.122.248 / Your IP : 216.73.216.15 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/test_tools/__pycache__/ |
Upload File : |
3 �w2_�! � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddl mZmZ e� G dd� dej �Zedkr|ej� dS ) z4Tests for the pindent script in the Tools directory.� N)�support)�assert_python_ok)� scriptsdir�skip_if_missingc @ sr e Zd Zejjed�Zdd� Zdd� Z dd� Z dd � Zd d� Zdd � Z dd� Zdd� Zdd� Zdd� Zdd� ZdS )�PindentTestsz pindent.pyc C s@ t |��.}t |��}| j|j� |j� � W d Q R X W d Q R X d S )N)�open�assertEqual� readlines)�selfZfn1Zfn2�f1�f2� r �A/opt/alt/python36/lib64/python3.6/test/test_tools/test_pindent.py�assertFileEqual s zPindentTests.assertFileEqualc G sJ t jtj| jf| t jt jdd��}|j|�\}}W d Q R X | j|� |S )NT)�stdin�stdoutZuniversal_newlines)� subprocess�Popen�sys� executable�script�PIPEZcommunicateZassertIsNone)r �source�args�proc�out�errr r r �pindent s zPindentTests.pindentc C s dj dd� |j� D ��d S )N� c s s | ]}|j � V qd S )N)�lstrip)�.0�liner r r � <genexpr>! s z+PindentTests.lstriplines.<locals>.<genexpr>)�join� splitlines)r �datar r r �lstriplines s zPindentTests.lstriplinesc J C sP d | _ tj� ��6}tjj|d�}t| j��}|j� }W d Q R X t|d��}|j |� W d Q R X t | jd|�\}}}| j|d� | j|d� |d }| jtjj |�� t|��}| j|j� |� W d Q R X t|��}|j� } W d Q R X t| dd� | j| j| d�|� | j| j|d�| � t | jd|�\}}}| j|d� | j|d� t|��}| j|j� | � W d Q R X t|��}| j|j� |� W d Q R X | j|�} t|d��}|j | � W d Q R X t | jd|�\}}}| j|d� | j|d� t|��}| j|j� | � W d Q R X t|��}|j� }W d Q R X t|dd� | j| j| d�|� W d Q R X d S ) Nz_test.py�wz-d� �~�execz-cz-r)ZmaxDiffr Ztemp_dir�os�pathr# r r �read�writer r Z assertTrue�exists�compiler r&