o
    թZh4                     @   s<   d dl Z d dlmZ e d d dlmZ G dd dZdS )    N)Series
matplotlibget_standard_colorsc                   @   s  e Zd Zejddg dfdg dfdg dfdd	d
gfdd	gfgdd Zejdddgfdg dfdg dfdg dfdg dfgdd Zejdddgfdg dfdg dfgdd Zejddg dfdg dfdg dfdg dfgdd  Z	ejddg d!fdg d!fdg d!fdg d!fdg d"fd#g d$fgd%d& Z
ejddd'gfdd'd'gfdg d(fgd)d* Zejd+d,dd,gfd-dd-d-gfd.dg d/fgd0d1 Zejd2d3g d4eg d5d6gd7d8 Zejd2g d9d:d; Zd<S )=TestGetStandardColorsznum_colors, expected   redgreenblue   )r	   r
   r   r	   r
      )r	   r
   r   r	   r
   r   r	      r	   r
      c                 C   sn   dd l }ddlm} d|g ddi}|j|d t|d}||ks%J W d    d S 1 s0w   Y  d S )Nr   cycleraxes.prop_cycler   colorrc
num_colorsr   Zmatplotlib.pyplotr   
rc_contextr   selfr   expectedmplr   Z
mpl_paramsresult r    W/var/www/html/lang_env/lib/python3.10/site-packages/pandas/tests/plotting/test_style.py)test_default_colors_named_from_prop_cycle
   s   
"z?TestGetStandardColors.test_default_colors_named_from_prop_cycleb)r#   gr   )r#   r$   r%   y)r#   r$   r%   r'   r#   )r#   r$   r%   r'   r#   r$   r%   c                 C   sj   dd l }ddlm} d|ddi}|j|d t|d}||ks#J W d    d S 1 s.w   Y  d S )Nr   r   r   Zbgryr   r   r   r   r   r    r    r!   0test_default_colors_named_from_prop_cycle_string   s   

"zFTestGetStandardColors.test_default_colors_named_from_prop_cycle_stringznum_colors, expected_nameC0)r)   C1C2   )r)   r*   r+   ZC3ZC4ZC5ZC6ZC7ZC8ZC9r)   r*   c                    sn   dd l }dd lm  |ji d  fdd|D }t|d}||ks%J W d    d S 1 s0w   Y  d S )Nr   r   c                    s   g | ]}  |qS r    )Zto_hex).0xZmcolorsr    r!   
<listcomp>Q   s    zXTestGetStandardColors.test_default_colors_named_undefined_prop_cycle.<locals>.<listcomp>r   )r   Zmatplotlib.colorscolorsr   r   )r   r   Zexpected_namer   r   r   r    r/   r!   .test_default_colors_named_undefined_prop_cycle4   s   
"zDTestGetStandardColors.test_default_colors_named_undefined_prop_cycler	   r
   皙?皙?333333?)r	   r
   r4   r	   c                 C   s$   g d}t ||d}||ksJ d S )Nr3   r   r   r   r   r   r   r   r   r    r    r!   test_user_input_color_sequenceU   s   
z4TestGetStandardColors.test_user_input_color_sequence)r%   r$   r#   k)r%   r$   r#   r;   r%      )r%   r$   r#   r;   r%   r$   c                 C       d}t ||d}||ksJ d S )NZrgbkr8   r   r9   r    r    r!   test_user_input_color_stringc   s   z2TestGetStandardColors.test_user_input_color_stringr4   )r4   r4   r4   c                 C   r=   )Nr4   r8   r   r9   r    r    r!   test_user_input_color_floatss   s   	z2TestGetStandardColors.test_user_input_color_floatszcolor, num_colors, expectedZCrimsonZ
DodgerBlue	firebrick)r@   r@   r@   c                 C   s   t ||d}||ksJ d S )Nr8   r   )r   r   r   r   r   r    r    r!   "test_user_input_named_color_string   s   	z8TestGetStandardColors.test_user_input_named_color_stringr    r    object)Zdtypec                 C   @   t jtdd t|dd W d    d S 1 sw   Y  d S )NzInvalid color argumentmatchr   r8   pytestZraises
ValueErrorr   r   r   r    r    r!   test_empty_color_raises   s   "z-TestGetStandardColors.test_empty_color_raises)	bad_color)r	   r
   rL   )r5   )r5   r6   )r5   r6   r7   g?g      ?c                 C   rD   )NzInvalid colorrE   r   r8   rG   rJ   r    r    r!   test_bad_color_raises   s   "z+TestGetStandardColors.test_bad_color_raisesN)__name__
__module____qualname__rH   markZparametrizer"   r(   r2   r:   r>   r?   rA   r   rK   rM   r    r    r    r!   r   	   s    













	




	













r   )rH   Zpandasr   ZimportorskipZ!pandas.plotting._matplotlib.styler   r   r    r    r    r!   <module>   s
    
