B
    ^K\                 @   sT   d Z ddlZddlZddlZddlZddlmZ dd Zdd Z	e
dkrPe  dS )	z
Tests for QtAwesome.
    N)
IconicFontc              C   s   t jddd} | dkstd S )Nz/python -c "import qtawesome ; qtawesome.icon()"T)shellr   )
subprocessZcallAssertionError)Zoutput_number r   =lib/python3.7/site-packages/qtawesome/tests/test_qtawesome.pytest_segfault_import   s    r   c             C   sL   t  }t|tst|j }|s(tdd t|	 D }|rHtdS )a"  
    Test that each font used by qtawesome has a unique name. If this test
    fails, this probably means that you need to rename the family name of
    some fonts. Please see PR #98 for more details on why it is necessary and
    on how to do this.

    Regression test for Issue #107
    c             S   s   g | ]\}}|d kr|qS )   r   ).0fontnamecountr   r   r   
<listcomp>'   s    z0test_unique_font_family_name.<locals>.<listcomp>N)
qtaZ	_instance
isinstancer   r   r   valuescollectionsCounteritems)ZqtbotresourceZ	fontnames
duplicatesr   r   r   test_unique_font_family_name   s    	
r   __main__)__doc__r   r   ZpytestZ	qtawesomer   Zqtawesome.iconic_fontr   r   r   __name__mainr   r   r   r   <module>   s   