OwlCyberSecurity - MANAGER
Edit File: test_tinypages.cpython-38.pyc
U ��]� � @ sV d Z ddlZddlmZmZmZ ddlmZm Z ddl Z ddlZe�d� dd� Z dS )z2Tests for tinypages build using sphinx extensions.� N)�join�dirname�isdir)�Popen�PIPEZsphinxc s� t t| �d�� t t| �d�}tjddddd|t tt�d�� g }t|ttdd �}|�� \}}|j d kstt d�||���|r�t� d�|�� t� �s�t �� fd d���fdd�tdd�D �\}}}t�|�d��s�t �t�|�d��s�t �t�|�d��s�t �t�|�d���st �t�|�d���s&t �t�|�d���s<t �tt � d�d��} | �� } W 5 Q R X d| k�snt �t�|t � d���s�t �t�|t � d���s�t �d| k�s�t �d S )NZhtmlZdoctreesz-msphinxz-Wz-bz-dZ tinypagesT)�stdout�stderrZuniversal_newlinesr z/sphinx build failed with stdout: {} stderr: {} z/sphinx build emitted the following warnings: {}c s t � d�| ��S )Nzsome_plots-{0}.png)�pjoin�format)Znum)�html_dir� �K/usr/lib/python3/dist-packages/matplotlib/sphinxext/tests/test_tinypages.py� plot_file s z!test_tinypages.<locals>.plot_filec s g | ]}� |��qS r r )�.0�i)r r r � <listcomp>! s z"test_tinypages.<locals>.<listcomp>� � � � � Z12_00Z12_01� zsome_plots.html�rbs # Only a commentz range4.pngz range6.pngs This is the caption for plot 15.)r �str�sys� executabler �__file__r r Zcommunicate� returncode�AssertionErrorr �pytestZfailr �range�filecmpZcmp�open�read)ZtmpdirZdoctree_dir�cmd�proc�out�errZrange_10Zrange_6Zrange_4ZfobjZ html_contentsr )r r r �test_tinypages s<