o
    tBhr	                     @  s   d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	m
Z
 ddlmZ ddlmZ ddlmZmZ dgZejejed	d	ZejZG d
d deZdS )zTest cases for invoking mypyc on the command line.

These are slow -- do not add test cases unless you have a very good reason to do so.
    )annotationsN)test_temp_dir)DataDrivenTestCase)normalize_error_messages)MypycDataSuiteassert_test_outputzcommandline.testz..c                   @  s"   e Zd ZeZeZdZd	ddZdS )
TestCommandLineTtestcaser   returnNonec              
   C  s  d |j}td|}|d usJ d|d }d|j }tj t	|}t
|d}|| W d    n1 s<w   Y  d}zOtjtjdd	g|tjtjd
d}	d|jv s_|	jdkrd||	j7 }|	jdkrt|tjt|gd
d7 }W tjdkr|dnd}
tjd|
 dd}|D ]}t| qntjdkrdnd}
tjd|
 dd}|D ]}t| qw dd |jD }t|  }t||d|d d S )N
z# *cmd: *(.*)z*Test case missing "# cmd: <files>" section   z_%s.pyw    z-mmypyctmp)stdoutstderrcwdErrorOutputr   )r   win32pydsoz	tmp/**/*.T)	recursivec                 S  s   g | ]}| d dqS )ztmp/ )replace).0x r   r/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/mypyc/test/test_commandline.py
<listcomp>E   s    z,TestCommandLine.run_case.<locals>.<listcomp>zInvalid output)expected)joininputresearchgroupsplitnameospathr   openwrite
subprocessrunsys
executablePIPESTDOUT
returncoder   check_outputpython3_pathplatformglobremoveoutputr   decode
splitlinesr   )selfr	   textmargsprogramprogram_pathfoutcmdsuffixso_pathsr*   r!   actualr   r   r   run_case!   sF   


zTestCommandLine.run_caseN)r	   r   r
   r   )__name__
__module____qualname__filesr   	base_pathoptional_outrH   r   r   r   r   r      s
    r   )__doc__
__future__r   r7   r)   os.pathr$   r-   r/   mypy.test.configr   mypy.test.datar   mypy.test.helpersr   mypyc.test.testutilr   r   rL   r*   r"   dirname__file__rM   r0   r5   r   r   r   r   r   <module>   s     