
    g                     n    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y)    )BytesIO)PathN)image_comparison)cmpyplotzpngsuite.pngg{Gz?)tolc                  4   t        t        t              j                  dz  j	                  d            } t        j                  t        |       df       t        |       D ][  \  }}t        j                  |      }d }|j                  dk(  rt        j                  }t        j                  |||dz   ddf|d       ] t        j                         j                  j!                  d	       t        j                         j#                  dt        |              y )
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        V/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/matplotlib/tests/test_png.pytest_pngsuiter%   
   s    	h		!;	;AA+NPE JJE
A'e$ 	/5zz% 99>77D 	

4AE1a 0t'-	/	/ GGIOO!!),GGIq#e*%    c                    | dz  }| dz  }t        j                  |       t        |d      5 }|j                         }d d d        t        |d      5 }|j	                  d d        d d d        t        j                  t              5  t        j                  |       d d d        y # 1 sw Y   jxY w# 1 sw Y   MxY w# 1 sw Y   y xY w)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KK	dD	 Shhj	fd	 t

3s8 
y	! 

6    s#   B&B2B>&B/2B;>Cc                  @   t               } t        j                  |        | j                  d       t        | j	                  d            }|j                  d       t        j                  t              5  t        j                  |       d d d        y # 1 sw Y   y xY w)Nr   r*   )	r   r   r+   seekr-   r/   r0   r1   r   )bb2s     r$   test_truncated_bufferr=   -   sh    	AKKNFF1I		BGGAJ	y	! 

2  s   5BB)ior   pathlibr   r/   matplotlib.testing.decoratorsr   
matplotlibr   r   r   r%   r8   r=    r&   r$   <module>rC      s<       : ( >"-& .&*
r&   