U
    ui;                     @   sf   d 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Z	ej
ddd	d
 ZG dd dZdS )zdevelop tests    N)Distribution   )contextsz7from setuptools import setup

setup(py_modules=['hi'])
function)Zscopec              	   c   sf   | d  d}|t W 5 Q R X | d  d}|d W 5 Q R X |   | V  W 5 Q R X d S )Nsetup.pywhi.pyz1
)openwriteSETUP_PYZas_cwd)Ztmpdirf r   C/tmp/pip-unpacked-wheel-9osl9suo/setuptools/tests/test_bdist_egg.pysetup_context   s    
r   c                   @   s6   e Zd Zdd Zejjej	dddddd Z
d	S )
Testc              	   C   sp   t tddgddgd}ttjdd t  |  |	  W 5 Q R X t
d\}td	|sltd S )
Nr   	bdist_eggZfoohi)script_namescript_argsname
py_modulesbuildsrcdistzfoo-0.0.0-py[23].\d+.egg$)r   dictosmakedirspathjoinr   quietparse_command_linerun_commandslistdirrematchAssertionError)selfr   user_overrider   contentr   r   r   test_bdist_egg   s    
zTest.test_bdist_eggZPYTHONDONTWRITEBYTECODEFzByte code disabled)reasonc              	   C   s   t tdddgdgd}t  |  |  W 5 Q R X td\}tj	d|}t
|}tdd |jD }d	|kstd
|kstd S )Nr   r   z--exclude-source-filesr   )r   r   r   r   c                 s   s   | ]}|j V  qd S )N)filename).0Zzir   r   r   	<genexpr>C   s     z1Test.test_exclude_source_files.<locals>.<genexpr>zhi.pycr   )r   r   r   r   r    r!   r   r"   r   r   zipfileZipFilelistfilelistr%   )r&   r   r'   r   	dist_nameZdist_filenamezipnamesr   r   r   test_exclude_source_files1   s     

zTest.test_exclude_source_filesN)__name__
__module____qualname__r)   pytestmarkZxfailr   environgetr5   r   r   r   r   r      s   r   )__doc__r   r#   r.   r9   Zsetuptools.distr    r   r   Zfixturer   r   r   r   r   r   <module>   s   

	