o
    hx                     @   s8   d dl Z d dlmZ g dZdd Zdd Zdd	 ZdS )
    N)FontProperties)
get_family	get_styleget_variant
get_weightget_sizec                  C   s   d} t  }t|}t |}tD ]}t|| t|| ks#J | | qd} t dddd}t|}t |}tD ]}t|| t|| ksKJ | | q7d} t dd	d
dddd}t|}t |}tD ]}t|| t|| ksvJ | | qbdS )z5Test converting a FontProperties to string then back.	defaults zbasic serif   italic)familysizestylefull z
sans-serif   boldoblique
small-capsexpandedr   r   weightr   variantstretchN)r   strkeysgetattr)testf1sf2k r!   |/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/matplotlib/tests/test_fontconfig_pattern.pytest_fontconfig_pattern   s,   &&&r#   c                  C   s   d} d}t |}t  }tD ]}t|| t|| ks!J | | qd} d}t |}t ddddd	d
d}tD ]}t|| t|| ksJJ | | q6dS )z7Test FontProperties string conversions for correctness.r   zNsans\-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0r   zFserif-24:style=oblique:variant=small-caps:weight=bold:stretch=expandedr	   r   r   r   r   r   r   N)r   r   r   )r   r   fontrightr    r!   r!   r"   test_fontconfig_str1   s    &&r&   c                   C   s<   t jtdd td W d    d S 1 sw   Y  d S )NParseException)matchz:unknown)pytestraises
ValueErrorr   r!   r!   r!   r"    test_fontconfig_unknown_constantK   s   
"r,   )r)   matplotlib.font_managerr   r   r#   r&   r,   r!   r!   r!   r"   <module>   s    	!