ó S˜Pc@`sVdZddlmZmZddlmZddlmZdefd„ƒYZdS(s? Tests for generic file descriptor based reactor support code. i(tdivisiontabsolute_import(tTestCase(t isIPAddresst AddressTestscB`sMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(s2 Tests for address-related functionality. cC`s*|jtdƒƒ|jtdƒƒdS(sx L{isIPAddress} should return C{True} for any decimal dotted representation of an IPv4 address. s0.1.2.3s252.253.254.255N(t assertTrueR(tself((s>/usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyttest_decimalDottedscC`sP|jtdƒƒ|jtdƒƒ|jtdƒƒ|jtdƒƒdS(sˆ L{isIPAddress} should return C{False} for a dotted decimal representation with fewer or more than four octets. t0s0.1s0.1.2s 0.1.2.3.4N(t assertFalseR(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyttest_shortDecimalDottedscC`s*|jtdƒƒ|jtdƒƒdS(s| L{isIPAddress} should return C{False} for any non-decimal dotted representation including letters. sa.2.3.4s1.b.3.4N(R R(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyttest_invalidLetters'scC`sP|jtdƒƒ|jtdƒƒ|jtdƒƒ|jtdƒƒdS(sl L{isIPAddress} should return C{False} for a string containing strange punctuation. t,s1,2s1,2,3s1.,.3,4N(R R(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyttest_invalidPunctuation0scC`s|jtdƒƒdS(sM L{isIPAddress} should return C{False} for the empty string. tN(R R(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyttest_emptyString;scC`sP|jtdƒƒ|jtdƒƒ|jtdƒƒ|jtdƒƒdS(sT L{isIPAddress} should return C{False} for negative decimal values. s-1s1.-2s1.2.-3s1.2.-3.4N(R R(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyttest_invalidNegativeBscC`sc|jtdƒƒ|jtdƒƒ|jtdƒƒ|jtdƒƒ|jtdƒƒdS(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.256s256.256.256.256N(R R(R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyttest_invalidPositiveLs ( t__name__t __module__t__doc__RR R R RRR(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyRs  N( Rt __future__RRttwisted.trial.unittestRttwisted.internet.abstractRR(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_abstract.pyts