o
    DDi.                     @   st   U d dl mZ d dlmZ d dlmZmZ d dlmZ ee	j
j
j
d Zeed< G dd deZG d	d
 d
eZdS )    )Path)TestCase)CSTTransformerparse_module)	is_nativeznative/libcst/tests/fixturesfixturesc                   @   s   e Zd ZdS )NOOPTransformerN)__name__
__module____qualname__ r   r   T/var/www/Datamplify/venv/lib/python3.10/site-packages/libcst/tests/test_roundtrip.pyr      s    r   c                   @   s2   e Zd Zdee fddZd	ddZd	ddZdS )
RoundTripTestsreturnc                 C   sF   t  s| d | t t d tt }| t|d |S )Nz)pure python parser doesn't work with thisz should existr   )	r   skipTest
assertTruer   existslistiterdirassertGreaterlen)selffilesr   r   r   _get_fixtures   s   
zRoundTripTests._get_fixturesNc              	   C   sj   |   D ].}| jt|d |jdd}t|}d | _| |j| W d    n1 s-w   Y  qd S N)filezutf-8)encoding)r   subTeststr	read_textr   maxDiffassertEqualcode)r   r   srcmodr   r   r   test_clean_roundtrip   s   z#RoundTripTests.test_clean_roundtripc              	   C   sz   t  }d | _|  D ]0}| jt|d |jdd}t|}||}| ||j	 W d    n1 s5w   Y  q
d S r   )
r   r    r   r   r   r   r   visitr!   r"   )r   transformerr   r#   r$   new_modr   r   r   test_transform_roundtrip%   s   
z'RoundTripTests.test_transform_roundtrip)r   N)r	   r
   r   r   r   r   r%   r)   r   r   r   r   r      s    
r   N)pathlibr   unittestr   libcstr   r   libcst._parser.entrypointsr   __file__parentr   __annotations__r   r   r   r   r   r   <module>   s   