
W1                 @   s   d  d l  Z  d  d l Z d  d l m Z d  d l m Z m Z d  d l m Z e d  d Z Gd d   d e e  j	  Z
 e
 f Z e d	 k r e e   d S)
    N)font)requiresrun_unittest)AbstractTkTestZguiZTkDefaultFontc               @   s   e  Z d  Z e d d    Z d d   Z d d   Z d d   Z d	 d
   Z d d   Z	 d d   Z
 d d   Z d d   Z d S)FontTestc             C   sx   t  j j |   y( t j d |  j d t d d  |  _ Wn9 t j k
 rs t j d |  j d t d d  |  _ Yn Xd  S)NrootnameexistsTF)	r   
setUpClass__func__r   Fontr   fontnametkinterZTclError)cls r   >/afs/.cs/s/python-3.5.2/amd64_ubu14/lib/python3.5/test_font.pyr
      s
    (zFontTest.setUpClassc             C   sL  |  j  j   } |  j t |  d d d d d d h  xI | D]A } |  j |  j  j |  | |  |  j |  j  | | |  q> WxU d D]M } |  j | | t  |  j |  j  j |  t  |  j |  j  | t  q W|  j r t	 n t } xU d D]M } |  j | | |  |  j |  j  j |  |  |  j |  j  | |  q Wd  S)	Nfamilysizeweightslant	underline
overstrike)zfamilyr   r   )zsizer   r   )
r   Z	configureassertGreaterEqualsetassertEqualZcgetassertIsInstancestrwantobjectsint)selfoptionskeysizetyper   r   r   test_configure   s     zFontTest.test_configurec             C   s  |  j  j   } |  j t |  d d d d d d h  x. | D]& } |  j |  j  j |  | |  q> Wx> d D]6 } |  j | | t  |  j |  j  j |  t  qo W|  j r t n t } x> d D]6 } |  j | | |  |  j |  j  j |  |  q Wd  S)	Nr   r   r   r   r   r   )zfamilyzweightzslant)zsizez	underlinez
overstrike)	r   actualr   r   r   r   r   r   r   )r   r    r!   r"   r   r   r   test_actual&   s    $ zFontTest.test_actualc             C   s3   |  j  |  j j t  |  j  t |  j  t  d  S)N)r   r   r   r   r   )r   r   r   r   	test_name4   s    zFontTest.test_namec             C   s   t  j d |  j d t d d  } t  j d |  j d t d d  } |  j | |  |  j | |  |  j | | j    |  j | d  d  S)Nr   r   r	   Tr   )r   r   r   r   ZassertIsNotr   ZassertNotEqualcopy)r   Zfont1Zfont2r   r   r   test_eq8   s    !!zFontTest.test_eqc             C   s    |  j  |  j j d  t  d  S)Nabc)r   r   Zmeasurer   )r   r   r   r   test_measure@   s    zFontTest.test_measurec             C   s   |  j  j   } |  j t |  d d d d h  x^ | D]V } |  j |  j  j |  | |  |  j | | t  |  j |  j  j |  t  q8 Wd  S)NZascentZdescentZ	linespaceZfixed)r   metricsr   r   r   r   r   )r   r+   r!   r   r   r   test_metricsC   s     zFontTest.test_metricsc             C   sa   t  j |  j  } |  j | t  |  j |  x+ | D]# } |  j | t  |  j |  q6 Wd  S)N)r   familiesr   r   tuple
assertTruer   )r   r-   r   r   r   r   test_familiesL   s    zFontTest.test_familiesc             C   sq   t  j |  j  } |  j | t  |  j |  x+ | D]# } |  j | t  |  j |  q6 W|  j t |  d  S)N)	r   namesr   r   r.   r/   r   ZassertInr   )r   r1   r   r   r   r   
test_namesT   s    zFontTest.test_namesN)__name__
__module____qualname__classmethodr
   r#   r%   r&   r(   r*   r,   r0   r2   r   r   r   r   r      s   	r   __main__)Zunittestr   r   Ztest.supportr   r   Ztkinter.test.supportr   r   ZTestCaser   Z	tests_guir3   r   r   r   r   <module>   s   
R	