
    h                     h    S SK Jr  S SKJr  S SKrS SKJr  S SKJrJ	r
  \" S/SS9S	 5       rS
 rS rg)    )BytesIO)PathN)image_comparison)cmpyplotzpngsuite.pngg{Gz?)tolc                  4   [        [        [        5      R                  S-  R	                  S5      5      n [
        R                  " [        U 5      S4S9  [        U 5       HZ  u  p[
        R                  " U5      nS nUR                  S:X  a  [        R                  n[
        R                  " X1US-   SS4USS9  M\     [
        R                  " 5       R                  R!                  S	5        [
        R                  " 5       R#                  S[        U 5      5        g )
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        K/var/www/html/env/lib/python3.13/site-packages/matplotlib/tests/test_png.pytest_pngsuiter%   
   s    	h		!;	;AA+NPE JJE
A'e$zz% 99>77D 	

4AE1a 0t'-	/ % GGIOO!!),GGIq#e*%    c                    U S-  nU S-  n[         R                  " U5        [        US5       nUR                  5       nS S S 5        [        US5       nUR	                  WS S 5        S S S 5        [
        R                  " [        5         [         R                  " U5        S S S 5        g ! , (       d  f       Nq= f! , (       d  f       NY= f! , (       d  f       g = f)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)B:	C)
B7:
C
Cc                  P   [        5       n [        R                  " U 5        U R                  S5        [        U R	                  S5      5      nUR                  S5        [
        R                  " [        5         [        R                  " U5        S S S 5        g ! , (       d  f       g = f)Nr   r*   )	r   r   r+   seekr-   r/   r0   r1   r   )bb2s     r$   test_truncated_bufferr=   -   s_    	AKKNFF1I		BGGAJ	y	!

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