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_ftp_options.pyc

ó
N
­Nc@svdZddlmZddlmZmZddlmZddlm	Z	ddl
mZdefd„ƒYZd	S(
s
Tests for L{twisted.tap.ftp}.
iÿÿÿÿ(tTestCase(tcredentialsterror(tOptions(tversions(tFilePathtFTPOptionsTestCasecBsAeZdZdZd„Zd„Zd„Zd„Zd„ZRS(	sJ
    Tests for the command line option parser used for C{twistd ftp}.
    tiamusertthisispasswordcCsG|jƒ|_t|jƒ}|jdj|jƒƒtƒ|_dS(s/
        Create a file with two users.
        t:N(tmktemptfilenameRt
setContenttjointusernamePasswordRtoptions(tselftf((sA/usr/lib/python2.7/dist-packages/twisted/test/test_ftp_options.pytsetUpscCs2|jtjddddƒ|jj|jƒdS(ss
        The C{--password-file} option will emit a warning stating that
        said option is deprecated.
        tTwistediiiN(tcallDeprecatedRtVersionRtopt_password_fileR(R((sA/usr/lib/python2.7/dist-packages/twisted/test/test_ftp_options.pyttest_passwordfileDeprecation"scCsUt|jdƒ}|jjdd|jgƒ|jt|jdƒ|dƒdS(sf
        The C{--auth} command-line option will add a checker to the list of
        checkers
        tcredCheckerss--authsfile:iN(tlenRtparseOptionsRtassertEqual(RtnumCheckers((sA/usr/lib/python2.7/dist-packages/twisted/test/test_ftp_options.pyttest_authAdded,scslˆjjddˆjgƒˆjdd}tjˆjddƒ}|j|ƒj‡fd†d„ƒS(	s×
        The checker created by the C{--auth} command-line option returns a
        L{Deferred} that fails with L{UnauthorizedLogin} when
        presented with credentials that are unknown to that checker.
        s--authsfile:Riÿÿÿÿitfakecs
ˆjdƒS(Ns!Wrong password should raise error(tfail(tignore(R(sA/usr/lib/python2.7/dist-packages/twisted/test/test_ftp_options.pyt<lambda>AscSs|jtjƒS(N(ttrapRtUnauthorizedLogin(terr((sA/usr/lib/python2.7/dist-packages/twisted/test/test_ftp_options.pyR!Bs(RRRRtUsernamePasswordRtrequestAvatarIdtaddCallbacks(Rtcheckertinvalid((RsA/usr/lib/python2.7/dist-packages/twisted/test/test_ftp_options.pyttest_authFailure6scsbˆjjddˆjgƒˆjdd}tjˆjŒ‰|jˆƒj‡‡fd†ƒS(sË
        The checker created by the C{--auth} command-line option returns a
        L{Deferred} that returns the avatar id when presented with credentials
        that are known to that checker.
        s--authsfile:Riÿÿÿÿcsˆj|ˆjƒS(N(Rtusername(R+(Rtcorrect(sA/usr/lib/python2.7/dist-packages/twisted/test/test_ftp_options.pyR!Os(RRRRR%RR&taddCallback(RR(((RR,sA/usr/lib/python2.7/dist-packages/twisted/test/test_ftp_options.pyttest_authSuccessEs
(RR(	t__name__t
__module__t__doc__RRRRR*R.(((sA/usr/lib/python2.7/dist-packages/twisted/test/test_ftp_options.pyRs	
	
	
	N(
R1ttwisted.trial.unittestRttwisted.credRRttwisted.tap.ftpRttwisted.pythonRttwisted.python.filepathRR(((sA/usr/lib/python2.7/dist-packages/twisted/test/test_ftp_options.pyt<module>s