ó
–"‰]c           @   su   d  Z  d d l Z d d l Z d d l Z d d l Z d d l m Z d „  Z d „  Z	 e
 d k rq e j ƒ  n  d S(   s   
Tests for QtAwesome.
iÿÿÿÿN(   t
   IconicFontc          C   s+   t  j d d t ƒ}  |  d k s' t ‚ d  S(   Ns/   python -c "import qtawesome ; qtawesome.icon()"t   shelli    (   t
   subprocesst   callt   Truet   AssertionError(   t   output_number(    (    s=   lib/python2.7/site-packages/qtawesome/tests/test_qtawesome.pyt   test_segfault_import   s    	c         C   s‡   t  j ƒ  } t | t ƒ s! t ‚ | j j ƒ  } | s< t ‚ g  t j | ƒ j	 ƒ  D] \ } } | d k rR | ^ qR } | sƒ t ‚ d S(   s"  
    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
    i   N(
   t   qtat	   _instancet
   isinstanceR    R   t   fontnamet   valuest   collectionst   Countert   items(   t   qtbott   resourcet	   fontnamesR   t   countt
   duplicates(    (    s=   lib/python2.7/site-packages/qtawesome/tests/test_qtawesome.pyt   test_unique_font_family_name   s    	7t   __main__(   t   __doc__R   R   t   pytestt	   qtawesomeR   t   qtawesome.iconic_fontR    R   R   t   __name__t   main(    (    (    s=   lib/python2.7/site-packages/qtawesome/tests/test_qtawesome.pyt   <module>   s   		