o
    թZhM                     @   sD   d dl Z d dlmZ d dlmZmZmZ e dZG dd dZ	dS )    N)	DataFrame)_check_plot_works_check_ticks_props_gen_two_subplotszmatplotlib.pyplotc                   @   s$   e Zd Zdd Zdd Zdd ZdS )
TestCommonc                 C   s$  t g dg dd}t|jdd}|jjdd d}tjt|d t|d	d
 W d    n1 s3w   Y  tjt|d t|d	d W d    n1 sPw   Y  tjt|d t|d	d W d    n1 smw   Y  tjt|d t|d	d W d    d S 1 sw   Y  d S )N)r      r   r         )ba   )Zrot)Zrotationzexpected 0.00000 but got )matchr   )Zxrot)Z
xlabelsize)Zyrot)Z
ylabelsize)	r   r   plotZyaxisZset_tick_paramspytestZraisesAssertionErrorr   )selfdfaxmsg r   X/var/www/html/lang_env/lib/python3.10/site-packages/pandas/tests/plotting/test_common.pytest__check_ticks_props   s    "z"TestCommon.test__check_ticks_propsc                 C   s   t  }tdd |dd}t| | g ksJ t| | }t|dks)J t|d   d d }|d  d7  < |g dksGJ d S )	Nc                  [   s   d S )Nr   )kwargsr   r   r   <lambda>   s    z;TestCommon.test__gen_two_subplots_with_ax.<locals>.<lambda>test)ffigr   r   r   )r	   r   r	   )	pltZgcfr   nextZget_axeslenlistZget_subplotspecZget_geometry)r   r   genaxesZsubplot_geometryr   r   r   test__gen_two_subplots_with_ax   s   z)TestCommon.test__gen_two_subplots_with_axc                 C   sv   t  }|d}g d}g d}|d ||}|d || |j||d |d gdd t|j|d d d S )	Nz+
            AB
            CC
            r   ABright)r   locationC)r   )r   ZfigureZsubplot_mosaicZscatterZcolorbarr   r   )r   r   r$   xyZcs0r   r   r   test_colorbar_layout+   s   zTestCommon.test_colorbar_layoutN)__name__
__module____qualname__r   r%   r-   r   r   r   r   r      s    r   )
r   Zpandasr   Zpandas.tests.plotting.commonr   r   r   Zimportorskipr   r   r   r   r   r   <module>   s
    
