Your IP : 216.73.216.85


Current Path : /opt/alt/python35/lib64/python3.5/distutils/tests/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/distutils/tests/__pycache__/test_check.cpython-35.opt-1.pyc



��Yf��@s�dZddlZddlZddlmZddlmZmZddlm	Z	ddl
mZyddlZWne
k
r�dZYnXGdd�de	je	jej�Zd	d
�Zedkr�ee��dS)z"Tests for distutils.command.check.�N)�run_unittest)�check�HAS_DOCUTILS)�support)�DistutilsSetupErrorc@s�eZdZddd�Zdd�Zejed�dd��Zejed�d	d
��Z	ejed�dd��Z
d
d�ZdS)�
CheckTestCaseNcKs�|dkri}|j|�\}}t|�}|j�x*|j�D]\}}t|||�qJW|j�|j�|S)N)�create_distrZinitialize_options�items�setattrZensure_finalizedZrun)�self�metadataZoptions�pkg_info�dist�cmd�name�value�r�?/opt/alt/python35/lib64/python3.5/distutils/tests/test_check.py�_runs


zCheckTestCase._runcCs|j�}|j|jd�ddddddddddi}|j|�}|j|jd�|jt|jid	d
i�|j|d	d
�}|j|jd�dddddddddddd
ddi}|j|�}|j|jd�dS)N��url�xxx�author�author_emailr�versionr�strict�uÉricZdescriptionuSomething about esszet ß�long_descriptionuMore things about esszet ß)r�assertEqual�	_warnings�assertRaisesr)rrrrrr�test_check_metadata s"z!CheckTestCase.test_check_metadatazwon't test without docutilscCsx|j�\}}t|�}d}|j|�}|jt|�d�d}|j|�}|jt|�d�dS)Nztitle
===

testrztitle
=====

testr)rr�_check_rst_datar�len)rr
rr�broken_rest�msgs�restrrr�test_check_documentAsz!CheckTestCase.test_check_documentcCs�d}|jd|�\}}t|�}|j�|j|jd�ddddddddd	dd|i}|jt|j|d
dddi�d|d<|j|d
ddd�}|j|jd
�dS)Nztitle
===

testrrrrrrrrr�restructuredtextutitle
=====

test ßr)rr�check_restructuredtextrrr rr)rr$r
rrrrrr�test_check_restructuredtextPs

z)CheckTestCase.test_check_restructuredtextcCs�g}|jtjd��|jtjd��x�|D]�}|jd|�\}}t|�}|j�|j|�}tdk	r�|jt	|�d�q9|jt	|�d�|jt
|dd�d�q9WdS)Nz}            Here's some code:

            .. code:: python

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

            .. code-block:: python

                def foo():
                    pass
            rrrz0Cannot analyze code. Pygments package not found.)�append�textwrap�dedentrrr)r"�pygmentsrr#�str)rZexample_rst_docsZrest_with_coder
rrr%rrr�1test_check_restructuredtext_with_syntax_highlightfs 



z?CheckTestCase.test_check_restructuredtext_with_syntax_highlightcCs;ddddi}|jt|jiddddi�dS)Nrrrrrr()r rr)rrrrr�test_check_all�s	zCheckTestCase.test_check_all)�__name__�
__module__�__qualname__rr!�unittestZ
skipUnlessrr'r*r0r1rrrrrs!$rcCs
tjt�S)N)r5Z	makeSuiterrrrr�
test_suite�sr6�__main__)�__doc__r,r5Ztest.supportrZdistutils.command.checkrrZdistutils.testsrZdistutils.errorsrr.�ImportErrorZLoggingSilencerZTempdirManagerZTestCaserr6r2rrrr�<module>s