Your IP : 216.73.216.213


Current Path : /opt/alt/python310/lib64/python3.10/distutils/tests/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/distutils/tests/__pycache__/test_check.cpython-310.pyc

o

0�iO�@s�dZddlZddlZddlZddlmZddlmZmZddl	m
Z
ddlmZzddl
Z
Wney9dZ
Ynwej�e�ZGdd�de
je
jej�Zd	d
�Zedkr\ee��dSdS)z"Tests for distutils.command.check.�N)�run_unittest)�check�HAS_DOCUTILS)�support)�DistutilsSetupErrorc@sbeZdZddd�Zdd�Ze�ed�dd��Ze�ed�d	d
��Z	e�ed�dd��Z
d
d�ZdS)�
CheckTestCaseNc
Ks�|duri}|durt��}t�|�|jdi|��\}}t|�}|��|��D]
\}}	t|||	�q)|��|�	�|durEt�|�|S)N�)
�os�getcwd�chdir�create_distrZinitialize_options�items�setattrZensure_finalized�run)
�self�metadata�cwdZoptionsZold_dir�pkg_info�dist�cmd�name�valuerr�A/opt/alt/python310/lib64/python3.10/distutils/tests/test_check.py�_runs

zCheckTestCase._runcCs�|��}|�|jd�dddddd�}|�|�}|�|jd�|jt|jifiddi��|j|dd�}|�|jd�dddddd	d
d�}|�|�}|�|jd�dS)N��xxx)�url�author�author_emailr�versionr�strict�)r uÉricuSomething about esszet ßuMore things about esszet ß)rrrrr�description�long_description)r�assertEqual�	_warnings�assertRaisesr)rrrrrr�test_check_metadata)s&�
�
z!CheckTestCase.test_check_metadatazwon't test without docutilscCsT|��\}}t|�}d}|�|�}|�t|�d�d}|�|�}|�t|�d�dS)N�title
===

testr!ztitle
=====

testr)rr�_check_rst_datar$�len)rrrr�broken_rest�msgs�restrrr�test_check_documentJs

z!CheckTestCase.test_check_documentcCs�d}|j|d�\}}t|�}|��|�|jd�ddddd|d�}|jt|j|fiddd���d|d<|j|ddd�}|�|jd	�d
|d<|j|tddd�}|�|jd	�dS)Nr(�r#r!r)rrrrrr#�r �restructuredtextutitle
=====

test ßr#rz)title
=====

.. include:: includetest.rst)rr r1)	rr�check_restructuredtextr$r%r&rr�HERE)rr+rrrrrrr�test_check_restructuredtextYs&��z)CheckTestCase.test_check_restructuredtextcCs�g}|�t�d��|�t�d��|D]8}|j|d�\}}t|�}|��|�|�}tdur8|�t	|�d�q|�t	|�d�|�t
|dd�d�qdS)Nz}            Here's some code:

            .. code:: python

                def foo():
                    pass
            z�            Here's some code:

            .. code-block:: python

                def foo():
                    pass
            r/rr!z0Cannot analyze code. Pygments package not found.)�append�textwrap�dedentrrr2r)�pygmentsr$r*�str)rZexample_rst_docsZrest_with_coderrrr,rrr�1test_check_restructuredtext_with_syntax_highlightts 	
��z?CheckTestCase.test_check_restructuredtext_with_syntax_highlightcCs,ddd�}|jt|jifiddd���dS)Nr)rrr!r0)r&rr)rrrrr�test_check_all�s

��
�zCheckTestCase.test_check_all)NN)�__name__�
__module__�__qualname__rr'�unittestZ
skipUnlessrr.r4r:r;rrrrrs

!




#rcCs
t�t�S)N)r?Z	makeSuiterrrrr�
test_suite�s
r@�__main__)�__doc__r	r6r?Ztest.supportrZdistutils.command.checkrrZdistutils.testsrZdistutils.errorsrr8�ImportError�path�dirname�__file__r3ZLoggingSilencerZTempdirManagerZTestCaserr@r<rrrr�<module>s.���