Your IP : 172.28.240.42


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


ypNc@sdZddlmZmZmZddlmZddlmZm	Z	ddl
mZmZddl
mZddlmZddlmZd	dd
YZdeefdYZd
eefdYZdS(s
Tests for the command-line scripts in the top-level I{bin/} directory.

Tests for actual functionality belong elsewhere, written in a way that doesn't
involve launching child processes.
i(tdevnulltgetcwdtchdir(t
executable(tPIPEtPopen(tSkipTesttTestCase(t	getModule(tFilePath(tZshScriptTestMixintScriptTestsMixincBs2eZdZedjjjdZdZRS(sr
    Mixin for L{TestCase} subclasses which defines a helper function for testing
    a Twisted-using script.
    ttwistedtbincCs|jj|}|js-tdnddlm}tt|jdgdt	dt
tjj
}|jt||dS(s
        Verify that the given script runs and uses the version of Twisted
        currently being tested.

        This only works when running tests against a vcs checkout of Twisted,
        since it relies on the scripts being in the place they are kept in
        version control, and exercises their logic for finding the right version
        of Twisted to use in that situation.

        @param name: A path fragment, relative to the I{bin} directory of a
            Twisted source checkout, identifying a script to test.
        @type name: C{str}

        @raise SkipTest: if the script is not where it is expected to be.
        s5Script tests do not apply to installed configuration.i(tversions	--versiontstdouttstderrN(R
tpreauthChildtexistsRttwisted.copyrightRRRtpathRtfileRRtreadtassertIntstr(tselftnametscriptRt
scriptVersion((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyt
scriptTests(	t__name__t
__module__t__doc__Rt	pathEntrytfilePathtchildR
R(((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyRstScriptTestscBsheZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZRS(s%
    Tests for the core scripts.
    cCs|jddS(Nttwistd(R(R((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyttest_twistd>scCs|jjd}|js-tdnt}|jt|t|j}|j	t|j
|jdjdtt
|j
ddgdtdttjj}|jt|j
|dS(	s
        The twistd script adds the current working directory to sys.path so
        that it's able to import modules from it.
        R%s5Script tests do not apply to installed configuration.sbar.tacsimport sys
print sys.path
s-nyRRN(R
R#RRRt
addCleanupRR	tmktemptmakedirsRt
setContentRRRRRRRRtrepr(RRtcwdttestDirtoutput((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyttest_twistdPathInsertBs	

cCs|jddS(Ntmanhole(R(R((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyttest_manholeYscCs|jddS(Nttrial(R(R((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyt
test_trial]scCs|jjd}|js-tdnt}|jt|t|j}|j	t|j
|jdjdtt
|j
dgdtdttjj}|jd|d	S(
s
        The trial script adds the current working directory to sys.path so that
        it's able to import modules from it.
        R2s5Script tests do not apply to installed configuration.sfoo.pyttfooRRtPASSEDN(R
R#RRRR'RR	R(R)RR*RRRRRRRR(RRR,R-R.((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyttest_trialPathInsertas	

cCs|jddS(Nt
pyhtmlizer(R(R((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyttest_pyhtmlizervscCs|jddS(Nttap2rpm(R(R((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyttest_tap2rpmzscCs|jddS(Nttap2deb(R(R((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyttest_tap2deb~scCs|jddS(Nt
tapconvert(R(R((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyttest_tapconvertscCsrddlm}|jd|jg}|jt|dd|jd|dd|jdt|d	S(
s
        The entire L{twisted.scripts.tkunzip} module, part of the old Windows
        installer tool chain, is deprecated.
        i(ttkunziptoffendingFunctionsitcategorysetwisted.scripts.tkunzip was deprecated in Twisted 11.1.0: Seek unzipping software outside of Twisted.tmessageiN(ttwisted.scriptsR@t
flushWarningsttest_deprecatedTkunziptassertEqualtDeprecationWarningtlen(RR@twarnings((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyRFs	(
RRR R&R/R1R3R7R9R;R=R?RF(((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyR$:s									tZshIntegrationTestCasecBs)eZdZdddddddgZRS(sH
    Test that zsh completion functions are generated without error
    R%s$twisted.scripts.twistd.ServerOptionsR2stwisted.scripts.trial.OptionsR8s twisted.scripts.htmlizer.OptionsR:s!twisted.scripts.tap2rpm.MyOptionsR<s!twisted.scripts.tap2deb.MyOptionsR>s)twisted.scripts.tapconvert.ConvertOptionsR0s!twisted.scripts.manhole.MyOptions(stwistds$twisted.scripts.twistd.ServerOptions(strialstwisted.scripts.trial.Options(s
pyhtmlizers twisted.scripts.htmlizer.Options(stap2rpms!twisted.scripts.tap2rpm.MyOptions(stap2debs!twisted.scripts.tap2deb.MyOptions(s
tapconverts)twisted.scripts.tapconvert.ConvertOptions(smanholes!twisted.scripts.manhole.MyOptions(RRR tgenerateFor(((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyRKsN((R tosRRRtsysRt
subprocessRRttwisted.trial.unittestRRttwisted.python.modulesRttwisted.python.filepathR	t"twisted.python.test.test_shellcompR
RR$RK(((sE/usr/lib/python2.7/dist-packages/twisted/scripts/test/test_scripts.pyt<module>	s%]