a
    zeR                     @   sh   d Z ddlZddlZddlZddlmZ ddlmZmZm	Z	 e	  G dd dej
Zedkrde  dS )zTests for scripts in the Tools directory.

This file contains extremely basic regression tests for the scripts found in
the Tools directory of a Python checkout or tarball which don't have separate
tests of their own.
    N)support)
scriptsdirimport_toolskip_if_missingc                   @   sb   e Zd Zg dZdgZdgZddgZee e e Zdd Ze	
ejdkd	d
d Zdd ZdS )TestSundryScripts)ZreindentZpdepsZ
gprof2htmlZmd5sumZ
make_ctypeZwin_add2pathanalyze_dxpZ2to3c                 C   sd   t  }zJttD ]0}|ds$q|d d }|| jv r<qt| qW t j|  nt j|  0 d S )Nz.py)	r   Zmodules_setuposlistdirr   endswithskiplistr   Zmodules_cleanup)selfZold_modulesfnname r   1/usr/lib/python3.9/test/test_tools/test_sundry.pytest_sundry    s    

zTestSundryScripts.test_sundrywin32zWindows-only testc                 C   s   | j D ]}t| qd S )N)windows_onlyr   )r   r   r   r   r   test_sundry_windows0   s    
z%TestSundryScripts.test_sundry_windowsc                 C   sJ   t tdrtd n2| t td W d    n1 s<0    Y  d S )NZgetdxpr   )hasattrsysr   ZassertRaisesRuntimeError)r   r   r   r   test_analyze_dxp_import5   s    

z)TestSundryScripts.test_analyze_dxp_importN)__name__
__module____qualname__Z	whitelistZ	blacklistr   otherr   r   unittestZskipIfr   platformr   r   r   r   r   r   r      s   
r   __main__)__doc__r	   r   r   testr   Ztest.test_toolsr   r   r   ZTestCaser   r   mainr   r   r   r   <module>   s   ,