Your IP : 216.73.216.213
3
��2a�! � @ s| d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl m
Z
mZ e� G dd� dej�Z
edkrxej� dS )� 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
�1/opt/alt/python36/lib64/python3.6/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&