ó
[łXMc           @   sC   d  Z  d d l m Z d d l m Z d e j f d     YZ d S(   s#   
Test cases for formmethod module.
i˙˙˙˙(   t   unittest(   t
   formmethodt   ArgumentTestCasec           B   sb   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z RS(
   c   	      O   sp   | d | |  } x- | D]% \ } } |  j  | j |  |  q Wx' | D] } |  j t j | j |  qI Wd  S(   Nt   name(   t   assertEqualst   coercet   assertRaisesR   t
   InputError(	   t   selft   argKlasst	   testPairst	   badValuest   argst   kwargst   argt   valt   result(    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt   argTest   s
    c         C   s   |  j  t j d d d g d  |  j  t j d d g d d d	 |  j  t j d d g d d d |  j  t j d d g d d d	 d d d  S(   Nt   ai   t   1t    t   abt   abct   2t   mini   t   223213t   345xt   maxi   t   addt   x(   R   R   (   i   R   (   R   R   (    (   R   R   (   s   abcs   abc(   R   R   (   R   R   (   R   R   (   R   R   (   R   R   (   s   adds   add(   R   R   (   R   R   t   String(   R   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt
   testString   s    ""c         C   sE   |  j  t j d
 d d g d  |  j  t j d d g d d d	 d  S(   Nt   3i   s   -2iţ˙˙˙R   t   qs   2.3t	   allowNonei    (   R    i   (   s   -2iţ˙˙˙(   R   N(   R!   s   2.3(   R    i   (   s   -2iţ˙˙˙(   R!   s   2.3R   (   R   R   t   Integert   None(   R   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt   testInt   s    c         C   sE   |  j  t j d
 d d g d  |  j  t j d d g d d d	 d  S(   NR    g      @s   -2.3gffffffŔR   R!   s   2.3zR"   i    (   R    g      @(   s   -2.3gffffffŔ(   R   N(   R!   s   2.3z(   R    g      @(   s   -2.3gffffffŔ(   R!   s   2.3zR   (   R   R   t   FloatR$   (   R   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt	   testFloat!   s    c         C   s2   d
 d g } |  j  t j d d g d d	 | d  S(   NR   t   apples   an applet   bt   bananat   ookt   ci   t   choices(   R   R(   s   an apple(   R)   R*   R+   (   R   R(   (   R)   R*   (   R,   i   (   R   R   t   Choice(   R   R-   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt
   testChoice&   s    	c         C   s_   d
 d g } |  j  t j d g d g f d d g d d g f g d d g d g f d	 | d  S(   NR   R(   s   an appleR)   R*   R+   R,   t   fdfst   flags(   R   s   apples   an apple(   R)   s   bananas   ook(   R   R   t   Flags(   R   R1   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt	   testFlags,   s    	'c         C   s,   d d d	 d
 g } |  j  t j | d  d  S(   Nt   yesi   R   i    t   Falset   no(   R4   i   (   R   i    (   s   Falsei    (   R6   i    (    (   R   R   t   Boolean(   R   t   tests(    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt   testBoolean4   s    c      	   C   sS   i d d 6d d 6d  d 6j   } d d d d d d g } |  j t j | |  d  S(    NiŇ  i   i   t   2002t   12t   21iĚ  i   i   t   1996R   t   29R   t   xxR    t   13R   t   1999t   32t   4(   iŇ  i   i   (   R:   R;   R<   (   iĚ  i   i   (   R=   R   R>   (   R   R   R   (   R:   R   R>   (   R?   R   R    (   R:   R@   R   (   RA   R;   RB   (   R:   R   (   R:   R   R    RC   (   R$   t   itemsR   R   t   Date(   R   t	   goodTestst   badTests(    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt   testDate8   s    c         C   sV   i d d 6d d 6d d 6j    } d d d	 d
 d g } |  j t j | | d d  d  S(   Ni    t   0i   R;   i   R    s   -1R   R@   s   -2000s   3.4(   RD   R   R   t   IntegerRange(   R   RF   RG   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt   testRangedIntegerC   s    !c         C   sX   i d d
 6d d 6j    } d d d d d d g } |  j t j | | d d d d	 d  S(   Nt   fooR   R   t   12345R   R   i   R   i   (   RL   RL   (   s   abs   ab(   s   abR   (   RM   RM   (   R   R   (   R   R   (   R   (   R   R   R   (   RD   R   R   t   VerifiedPassword(   R   RF   RG   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt   testVerifiedPasswordH   s    (   t   __name__t
   __module__R   R   R%   R'   R/   R3   R9   RH   RK   RO   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyR      s   									N(   t   __doc__t   twisted.trialR    t   twisted.pythonR   t   TestCaseR   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/test/test_formmethod.pyt   <module>   s   