Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/test/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyc


=Nc@sdZddlmZddlmZddlmZddlmZddlm	Z	ddl
mZmZdefd	YZ
d
efdYZdS(
s,
Tests for L{twisted.application.strports}.
i(tTestCase(tstrports(tinternet(tParserTestCase(tFactory(tTCP4ServerEndpointtUNIXServerEndpointtDeprecatedParseTestCasecBs)eZdZdZdZdZRS(s
    L{strports.parse} is deprecated.  It's an alias for a method that is now
    private in L{twisted.internet.endpoints}.
    cOsYtj||}|j|jg}|jt|d|j|ddd|S(Niitmessages|twisted.application.strports.parse was deprecated in Twisted 10.2.0: in favor of twisted.internet.endpoints.serverFromString(Rtparset
flushWarningstassertEqualtlen(tselftatkwtresulttwarnings((s>/usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyR	scCsC|j|jd|jdd|jfidd6dd6fdS(	s=
        Base numeric ports should be parsed as TCP.
        t80tTCPiPtt	interfacei2tbacklogN(RR	tf(R
((s>/usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyttest_simpleNumeric"scCsC|j|jd|jdd|jfidd6dd6fdS(	s
        A collection of keyword arguments with no prefixed type, like 'port=80',
        will be parsed as keyword arguments to 'tcp'.
        sport=80RiPRRi2RN(RR	R(R
((s>/usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyttest_allKeywords*s(t__name__t
__module__t__doc__R	RR(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyRs		tServiceTestCasecBs2eZdZdZdZdZdZRS(s(
    Tests for L{strports.service}.
    cCst}t}d}tjdt||d|}|j|tj|j|j	t
|j|jt|j|jj
||j|j||j|jj|dS(s
        L{strports.service} returns a L{StreamServerEndpointService}
        constructed with an endpoint produced from
        L{endpoint.serverFromString}, using the same syntax.
        i9stcp:treactorN(tobjectRRtservicetstrtassertIsInstanceRtStreamServerEndpointServiceRt_raiseSynchronouslytTruetendpointRt_porttassertIdenticaltfactoryt_reactor(R
RtaFactoryt	aGoodPorttsvc((s>/usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyttest_service9s		cCs<ddlm}tjdd}|j|jj|dS(sp
        L{strports.service} will use the default reactor when none is provided
        as an argument.
        i(Rstcp:80N(ttwisted.internetRRR tNoneR(R&R*(R
t
globalReactortaService((s>/usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyttest_serviceDefaultReactorPscCs
tjdd
d}|j|jt|j|jg}|j|ddt	|j|ddd|jt
|dtjdd
d
}|j|jt|j|jg}|j|ddt	|j|ddd	|jt
|dd
S(s
        L{strports.service} still accepts a 'default' argument, which will
        affect the parsing of 'default' (i.e. 'not containing a colon')
        endpoint descriptions, but this behavior is deprecated.
        t8080tunixitcategoryRsxThe 'default' parameter was deprecated in Twisted 10.2.0.  Use qualified endpoint descriptions; for example, 'tcp:8080'.istcp:8080s9The 'default' parameter was deprecated in Twisted 10.2.0.N(RR R0R"R&RR
ttest_serviceDeprecatedDefaultRtDeprecationWarningRR(R
R-R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyR7Zs cCstjdd}|j|jt|j|jg}|j|ddt	|j|ddd|jt
|ddS(sP
        Unqualified strport descriptions, i.e. "8080", are deprecated.
        R4iR6RsqUnqualified strport description passed to 'service'.Use qualified endpoint descriptions; for example, 'tcp:8080'.iN(RR R0R"R&RR
t!test_serviceDeprecatedUnqualifiedRR8R(R
R-R((s>/usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyR9vs(RRRR.R3R7R9(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyR4s
		
	N(Rttwisted.trial.unittestRttwisted.applicationRRt$twisted.internet.test.test_endpointsRttwisted.internet.protocolRttwisted.internet.endpointsRRRR(((s>/usr/lib/python2.7/dist-packages/twisted/test/test_strports.pyt<module>s#