a
    åzeî  ã                   @   sh   d Z ddlZddlZddlmZ ddlmZ ddlmZm	Z	 e	ƒ  G dd„ dej
ƒZedkrde ¡  dS )	zºTests for scripts in the Tools directory.

This file contains regression tests for some of the scripts found in the
Tools directory of a Python checkout or tarball, such as reindent.py.
é    N)Úassert_python_ok)Úfindfile)Ú
scriptsdirÚskip_if_missingc                   @   s2   e Zd Zej ed¡Zdd„ Zdd„ Z	dd„ Z
dS )	ÚReindentTestszreindent.pyc                 C   s   t | jƒ d S )N)r   Úscript)Úself© r	   ú3/usr/lib/python3.9/test/test_tools/test_reindent.pyÚtest_noargs   s    zReindentTests.test_noargsc                 C   s.   t | jdƒ\}}}|  |d¡ |  |d¡ d S )Nz-hó    )r   r   ÚassertEqualZassertGreater)r   ÚrcÚoutÚerrr	   r	   r
   Ú	test_help   s    zReindentTests.test_helpc                 C   s8   t dƒ}t| jd|ƒ\}}}|  |d¡ |  |d¡ d S )Nzbad_coding.pyz-rr   )r   r   r   r   ZassertNotEqual)r   Zbad_coding_pathr   r   r   r	   r	   r
   Ú$test_reindent_file_with_bad_encoding   s    z2ReindentTests.test_reindent_file_with_bad_encodingN)Ú__name__Ú
__module__Ú__qualname__ÚosÚpathÚjoinr   r   r   r   r   r	   r	   r	   r
   r      s   r   Ú__main__)Ú__doc__r   ZunittestZtest.support.script_helperr   Ztest.supportr   Ztest.test_toolsr   r   ZTestCaser   r   Úmainr	   r	   r	   r
   Ú<module>   s   