
    P/Ph                     |    d dl mZ d dlmZ d dlZd dlmZ d dlmZm	Z
  edgd          d	             Zd
 Zd ZdS )    )BytesIO)PathN)image_comparison)cmpyplotzpngsuite.pngg{Gz?)tolc                  F   t          t          t                    j        dz                      d                    } t          j        t          |           df           t          |           D ]Q\  }}t          j	        |          }d }|j
        dk    rt          j        }t          j        |||dz   ddf|d           Rt          j                    j                            d	           t          j                                        dt          |                      d S )
Nzbaseline_images/pngsuitez	basn*.png   )figsize   r   data)extentcmapinterpolation_stagez#ddffff)sortedr   __file__parentglobpltfigurelen	enumerateimreadndimr   grayimshowgcapatchset_facecolorset_xlim)filesifnamer   r   s        Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/matplotlib/tests/test_png.pytest_pngsuiter%   
   s   	h	!;	;AA+NNP PE JE

A''''e$$ 	/ 	/5z%  9>>7D 	
4AE1a 0t'-	/ 	/ 	/ 	/ 	/ GIIO!!),,,GIIq#e**%%%%%    c                    | dz  }| dz  }t          j        |           t          |d          5 }|                                }d d d            n# 1 swxY w Y   t          |d          5 }|                    |d d                    d d d            n# 1 swxY w Y   t          j        t                    5  t          j        |           d d d            d S # 1 swxY w Y   d S )Nztest.pngztest_truncated.pngrbwb   )	r   savefigopenreadwritepytestraises	Exceptionr   )tmp_pathpathpath_tfinbuffouts         r$   test_truncated_filer8       s   j D,,FK	dD		 Shhjj              	fd		 t

3ss8               
y	!	!  
6                 s5   AAA+BBB9CC"Cc                  n   t                      } t          j        |            |                     d           t          |                     d                    }|                    d           t          j        t                    5  t          j        |           d d d            d S # 1 swxY w Y   d S )Nr   r*   )	r   r   r+   seekr-   r/   r0   r1   r   )bb2s     r$   test_truncated_bufferr=   -   s    		AKNNNFF1III			BGGAJJJ	y	!	!  
2                 s   B**B.1B.)ior   pathlibr   r/   matplotlib.testing.decoratorsr   
matplotlibr   r   r   r%   r8   r=    r&   r$   <module>rC      s                 : : : : : : ( ( ( ( ( ( ( ( >"---& & .-&*
 
 
    r&   