o
    _~#g4                     @   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   matplotlib.pyplotr   
rc_contextr   selfr   expectedmplr   
mpl_paramsresult r"   /var/www/static.ux5.de/https/Moving-Object-Detection-with-OpenCV/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   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.   C3C4C5C6C7C8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"   )to_hex).0xmcolorsr"   r#   
<listcomp>Q   s    zXTestGetStandardColors.test_default_colors_named_undefined_prop_cycle.<locals>.<listcomp>r   )r   matplotlib.colorscolorsr   r   )r   r   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
   rB   r	   c                 C   s$   g d}t ||d}||ksJ d S )NrA   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%   rI   r'      )r'   r&   r%   rI   r'   r&   c                 C       d}t ||d}||ksJ d S )NrgbkrF   r   rG   r"   r"   r#   test_user_input_color_stringc   s   z2TestGetStandardColors.test_user_input_color_stringrB   )rB   rB   rB   c                 C   rK   )NrB   rF   r   rG   r"   r"   r#   test_user_input_color_floatss   s   	z2TestGetStandardColors.test_user_input_color_floatszcolor, num_colors, expectedCrimson
DodgerBlue	firebrick)rQ   rQ   rQ   c                 C   s   t ||d}||ksJ d S )NrF   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)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   rF   pytestraises
ValueErrorr   r   r   r"   r"   r#   test_empty_color_raises   s   "z-TestGetStandardColors.test_empty_color_raises)	bad_color)r	   r
   r_   )rC   )rC   rD   )rC   rD   rE   g?g      ?c                 C   rV   )NzInvalid colorrW   r   rF   rY   r]   r"   r"   r#   test_bad_color_raises   s   "z+TestGetStandardColors.test_bad_color_raisesN)__name__
__module____qualname__rZ   markparametrizer$   r+   r@   rH   rM   rN   rR   r   r^   r`   r"   r"   r"   r#   r   	   s    













	




	













r   )rZ   pandasr   importorskip!pandas.plotting._matplotlib.styler   r   r"   r"   r"   r#   <module>   s
    
