ó
[³XMc           @   s@   d  Z  d d l m Z d d l m Z d e f d „  ƒ  YZ d S(   s?   
Tests for generic file descriptor based reactor support code.
iÿÿÿÿ(   t   TestCase(   t   isIPAddresst   AddressTestsc           B   sM   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   s2   
    Tests for address-related functionality.
    c         C   s*   |  j  t d ƒ ƒ |  j  t d ƒ ƒ d S(   sx   
        L{isIPAddress} should return C{True} for any decimal dotted
        representation of an IPv4 address.
        s   0.1.2.3s   252.253.254.255N(   t
   assertTrueR   (   t   self(    (    s>   /usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyt   test_decimalDotted   s    c         C   sP   |  j  t d ƒ ƒ |  j  t d ƒ ƒ |  j  t d ƒ ƒ |  j  t d ƒ ƒ d S(   sˆ   
        L{isIPAddress} should return C{False} for a dotted decimal
        representation with fewer or more than four octets.
        t   0s   0.1s   0.1.2s	   0.1.2.3.4N(   t   assertFalseR   (   R   (    (    s>   /usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyt   test_shortDecimalDotted   s    c         C   s*   |  j  t d ƒ ƒ |  j  t d ƒ ƒ d S(   s|   
        L{isIPAddress} should return C{False} for any non-decimal dotted
        representation including letters.
        s   a.2.3.4s   1.b.3.4N(   R   R   (   R   (    (    s>   /usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyt   test_invalidLetters%   s    c         C   sP   |  j  t d ƒ ƒ |  j  t d ƒ ƒ |  j  t d ƒ ƒ |  j  t d ƒ ƒ d S(   sl   
        L{isIPAddress} should return C{False} for a string containing
        strange punctuation.
        t   ,s   1,2s   1,2,3s   1.,.3,4N(   R   R   (   R   (    (    s>   /usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyt   test_invalidPunctuation.   s    c         C   s   |  j  t d ƒ ƒ d S(   sM   
        L{isIPAddress} should return C{False} for the empty string.
        t    N(   R   R   (   R   (    (    s>   /usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyt   test_emptyString9   s    c         C   sP   |  j  t d ƒ ƒ |  j  t d ƒ ƒ |  j  t d ƒ ƒ |  j  t d ƒ ƒ d S(   sT   
        L{isIPAddress} should return C{False} for negative decimal values.
        s   -1s   1.-2s   1.2.-3s   1.2.-3.4N(   R   R   (   R   (    (    s>   /usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyt   test_invalidNegative@   s    c         C   sc   |  j  t d ƒ ƒ |  j  t d ƒ ƒ |  j  t d ƒ ƒ |  j  t d ƒ ƒ |  j  t d ƒ ƒ d S(   s   
        L{isIPAddress} should return C{False} for a string containing
        positive decimal values greater than 255.
        s	   256.0.0.0s	   0.256.0.0s	   0.0.256.0s	   0.0.0.256s   256.256.256.256N(   R   R   (   R   (    (    s>   /usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyt   test_invalidPositiveJ   s
    (
   t   __name__t
   __module__t   __doc__R   R   R	   R   R   R   R   (    (    (    s>   /usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyR      s   								
N(   R   t   twisted.trial.unittestR    t   twisted.internet.abstractR   R   (    (    (    s>   /usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyt   <module>   s   