
[XMc           @   s  d  Z  d d l Z d d l Z d d l m Z d d l m Z d d l m Z m	 Z	 m
 Z
 m Z d d l m Z m Z d d l m Z d d l m Z d d	 l m Z y d d l Z Wn e k
 r d Z n Xy d d l Z Wn e k
 r d Z n Xy d d l Z Wn e k
 r#d Z n Xd
   Z d e j f d     YZ d e j f d     YZ d e j f d     YZ d e j f d     YZ d e j f d     YZ  d e j f d     YZ! d e j" e j# f d     YZ$ d e j f d     YZ% d e j" e j# f d     YZ& d e j" e j# f d     YZ' d e j" e j# f d      YZ( d! e j" e j# f d"     YZ) d# e j f d$     YZ* d S(%   s$   
Tests for L{twisted.cred.strcred}.
iN(   t   plugin(   t   unittest(   t   credentialst   checkerst   errort   strcred(   t	   cred_filet   cred_anonymous(   t   usage(   t   FilePath(   t   UserDatabasec          C   sC   d }  x6 |  g  t  j   D] } | j ^ q k r> |  d 7}  q	 W|  S(   sC   
    Helper method to produce an auth type that doesn't exist.
    t   ThisPluginDoesNotExistt   _(   R   t   findCheckerFactoriest   authType(   t   invalidAuthTypet   factory(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   getInvalidAuthType$   s
    %t   TestPublicAPIc           B   s   e  Z d    Z d   Z RS(   c         C   s?   t    } |  j t j t j |  |  j t j t j |  d S(   sC   
        Test that the description string cannot be empty.
        N(   R   t   assertRaisesR   t   InvalidAuthTypet   makeCheckert   findCheckerFactory(   t   selft   iat(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_emptyDescription2   s    	c         C   s?   t    } |  j t j t j |  |  j t j t j |  d S(   sJ   
        Test that an unrecognized auth type raises an exception.
        N(   R   R   R   R   R   R   (   R   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_invalidAuthType;   s    	(   t   __name__t
   __module__R   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR   0   s   		t   TestStrcredFunctionsc           B   s   e  Z d    Z d   Z RS(   c         C   sC   t  t j    } x* t j t j  D] } |  j | |  q% Wd S(   sO   
        Test that findCheckerFactories returns all available plugins.
        N(   t   listR   R   R    t
   getPluginst   ICheckerFactoryt   assertIn(   R   t   availablePluginst   plg(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_findCheckerFactoriesG   s    c         C   s    |  j  t j d  t j  d S(   sz   
        Test that findCheckerFactory returns the first plugin
        available for a given authentication type.
        t   fileN(   t   assertIdenticalR   R   R   t   theFileCheckerFactory(   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_findCheckerFactoryP   s    (   R   R   R$   R(   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR   E   s   		t   TestMemoryCheckerc           B   s>   e  Z d    Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   sj   t  j d d  |  _ t  j d d  |  _ t  j d d  |  _ t  j d d  |  _ t j d  |  _ d  S(	   Nt   admint   asdft   alicet   foot   foobart   xt   yzs   memory:admin:asdf:alice:foo(	   R   t   UsernamePasswordR*   R,   t   badPasst   badUserR   R   t   checker(   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   setUp\   s
    c         C   s9   |  j  t j j |  j   |  j t j |  j j  d S(   s   
        Verifies that strcred.makeChecker('memory') returns an object
        that implements the L{ICredentialsChecker} interface.
        N(	   t
   assertTrueR   t   ICredentialsCheckert
   providedByR4   R!   R   t   IUsernamePasswordt   credentialInterfaces(   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_isCheckerd   s    c         C   s   |  j  t j t j d  d S(   s   
        Test that an argument string which does not contain user:pass
        pairs (i.e., an odd number of ':' characters) raises an exception.
        s   memory:a:b:cN(   R   R   t   InvalidAuthArgumentStringR   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_badFormatArgStringn   s    c            s+     f d   }   j  j   j  j |  S(   sE   
        Test that the checker works with valid credentials.
        c            s     j  |    j j  d  S(   N(   t   assertEqualsR*   t   username(   R?   (   R   (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt
   _gotAvatar{   s    (   R4   t   requestAvatarIdR*   t   addCallback(   R   R@   (    (   R   s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_memoryCheckerSucceedsw   s    	c         C   s"   |  j  |  j j |  j  t j  S(   sG   
        Test that the checker fails with an invalid username.
        (   t   assertFailureR4   RA   R3   R   t   UnauthorizedLogin(   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_memoryCheckerFailsUsername   s    c         C   s"   |  j  |  j j |  j  t j  S(   sG   
        Test that the checker fails with an invalid password.
        (   RD   R4   RA   R2   R   RE   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_memoryCheckerFailsPassword   s    (   R   R   R5   R;   R=   RC   RF   RG   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR)   Z   s   		
				t   TestAnonymousCheckerc           B   s   e  Z d    Z d   Z RS(   c         C   sB   t  j d  } |  j t j j |   |  j t j | j	  d S(   s   
        Verifies that strcred.makeChecker('anonymous') returns an object
        that implements the L{ICredentialsChecker} interface.
        t	   anonymousN(
   R   R   R6   R   R7   R8   R!   R   t
   IAnonymousR:   (   R   R4   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR;      s    c            s@   t  j d  } | j t j    }   f d   } | j |  S(   sI   
        Test that we can log in anonymously using this checker.
        RI   c            s     j  t j |   d  S(   N(   R&   R   t	   ANONYMOUS(   t   avatar(   R   (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR@      s    (   R   R   RA   R   t	   AnonymousRB   (   R   R4   t   requestR@   (    (   R   s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   testAnonymousAccessSucceeds   s    (   R   R   R;   RO   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyRH      s   	
t   TestUnixCheckerc           B   s   e  Z i d  d 6d d 6Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z	 d e e e f k r g  Z xK e d f e d f e d f f D]( \ Z Z e d k r e e g 7Z q q Wx0 e e e	 f D] Z d d j e  e _ q Wn  RS(   R+   R*   R-   R,   c      	   C   s2   | t  j  |  j | d  d d d d d d d f	 S(   Ns   F/i    i i   i(   t   cryptt   users(   R   R?   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   _spwd   s    c      	   C   s  t  j d d  |  _ t  j d d  |  _ t  j d d  |  _ t  j d d  |  _ t j d  |  _ t	 r t
   } xL |  j j   D]; \ } } | j | t j | d	  d
 d
 | d | d  q W|  j t	 d | j  n  t r t j |  _ |  j t _ n  d  S(   NR*   R+   R,   R-   R.   R/   R0   t   unixs   F/i  s   /home/s   /bin/sht   getpwnam(   R   R1   R*   R,   R2   R3   R   R   R4   t   pwdR
   RR   t   itemst   addUserRQ   t   patchRU   t   spwdt   getspnamt   _spwd_getspnamRS   (   R   t   databaseR?   t   password(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR5      s    	c         C   s   t  r |  j t  _ n  d  S(   N(   RZ   R\   R[   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   tearDown   s    c         C   s9   |  j  t j j |  j   |  j t j |  j j  d S(   s   
        Verifies that strcred.makeChecker('unix') returns an object
        that implements the L{ICredentialsChecker} interface.
        N(	   R6   R   R7   R8   R4   R!   R   R9   R:   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR;      s    c            s+     f d   }   j  j   j  j |  S(   sE   
        Test that the checker works with valid credentials.
        c            s     j  |    j j  d  S(   N(   R>   R*   R?   (   R?   (   R   (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR@      s    (   R4   RA   R*   RB   (   R   R@   (    (   R   s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_unixCheckerSucceeds   s    	c         C   s"   |  j  |  j j |  j  t j  S(   sG   
        Test that the checker fails with an invalid username.
        (   RD   R4   RA   R3   R   RE   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_unixCheckerFailsUsername   s    c         C   s"   |  j  |  j j |  j  t j  S(   sG   
        Test that the checker fails with an invalid password.
        (   RD   R4   RA   R2   R   RE   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_unixCheckerFailsPassword   s    RV   t   swpdRQ   s$   Required module(s) are unavailable: s   , N(   R   R   RR   RS   R5   R_   R;   R`   Ra   Rb   t   NoneRV   RZ   RQ   t   availabilityt   modulet   namet   methodt   joint   skip(    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyRP      s(   
				
			.t   TestFileDBCheckerc           B   sV   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(	   s4   
    Test for the --auth=file:... file checker.
    c         C   s   t  j d d  |  _ t  j d d  |  _ t  j d d  |  _ t  j d d  |  _ |  j   |  _ t |  j  j	 d  t
 j d	 |  j  |  _ d  S(
   NR*   R+   R,   R-   R.   R/   R0   s   admin:asdf
alice:foo
s   file:(   R   R1   R*   R,   R2   R3   t   mktempt   filenameR	   t
   setContentR   R   R4   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR5     s    c         C   s-   d } x  t  j j |  r( | d 7} q	 W| S(   Ns   /DoesNotExistR   (   t   ost   patht   exists(   R   Rm   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   _fakeFilename  s    c         C   s9   |  j  t j j |  j   |  j t j |  j j  d S(   s   
        Verifies that strcred.makeChecker('memory') returns an object
        that implements the L{ICredentialsChecker} interface.
        N(	   R6   R   R7   R8   R4   R!   R   R9   R:   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR;     s    c            s+     f d   }   j  j   j  j |  S(   sE   
        Test that the checker works with valid credentials.
        c            s     j  |    j j  d  S(   N(   R>   R*   R?   (   R?   (   R   (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR@   '  s    (   R4   RA   R*   RB   (   R   R@   (    (   R   s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_fileCheckerSucceeds#  s    	c         C   s"   |  j  |  j j |  j  t j  S(   sG   
        Test that the checker fails with an invalid username.
        (   RD   R4   RA   R3   R   RE   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_fileCheckerFailsUsername.  s    c         C   s"   |  j  |  j j |  j  t j  S(   sG   
        Test that the checker fails with an invalid password.
        (   RD   R4   RA   R2   R   RE   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_fileCheckerFailsPassword6  s    c         C   s0   |  j  t t j d  |  j  t t j d  d S(   s>   
        Test that an empty filename raises an error.
        R%   s   file:N(   R   t
   ValueErrorR   R   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_failsWithEmptyFilename>  s    c         C   sf   t  j j } t j   } | t  j _ t j d |  j    } | t  j _ |  j t  j | j	    d S(   st   
        When the file auth plugin is given a file that doesn't exist, it
        should produce a warning.
        s   file:N(
   R   R'   t   errorOutputt   StringIOR   R   Rr   R!   t   invalidFileWarningt   getvalue(   R   t	   oldOutputt	   newOutputR4   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_warnWithBadFilenameF  s    (   R   R   t   __doc__R5   Rr   R;   Rs   Rt   Ru   Rw   R~   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyRk     s   	
		
				t   DummyOptionsc           B   s   e  Z d  Z RS(   s@   
    Simple options for testing L{strcred.AuthOptionMixin}.
    (   R   R   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR   T  s   t   TestCheckerOptionsc           B   sP   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   c         C   sv   t    } | j d d g  |  j t | d  d  t    } | j d d d d g  |  j t | d  d  d S(   s|   
        Test that the --auth command line creates a list in the
        Options instance and appends values to it.
        s   --autht   memoryt   credCheckersi   i   N(   R   t   parseOptionst   assertEqualt   len(   R   t   options(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_createsList]  s    		c         C   sT   t    } t   } |  j t j | j d | g  |  j t j | j d | g  d S(   s   
        Test that the --auth command line raises an exception when it
        gets a parameter it doesn't understand.
        s   --auths   --help-auth-typeN(   R   R   R   R   t
   UsageErrorR   (   R   R   t   invalidParameter(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_invalidAuthErrorj  s    		c         C   s   t    } | j d d d d g  | d } |  j t | t j  d  |  j t | t j  d  | t j d } | t j d } |  j t j	 j
 |   |  j t j	 j
 |   |  j t j | j  |  j t j | j  d S(   s   
        Test that the --auth command line creates a dictionary
        mapping supported interfaces to the list of credentials
        checkers that support it.
        s   --authR   RI   t   credInterfacesi   i    N(   R   R   R>   R   R   RJ   R9   R6   R   R7   R8   R!   R:   (   R   R   t   chdt   chdAnonymoust   chdUserPass(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_createsDictionary{  s    	

c         C   sE   t    } | j d d d d g  |  j | d | d t j  d S(   s   
        Test that when two --auth arguments are passed along which
        support the same interface, a list with both is created.
        s   --authR   RT   R   R   N(   R   R   R>   R   R9   (   R   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt    test_credInterfacesProvidesLists  s
    	c         C   sM   g  } t    } x7 | j   D]) } |  j | j |  | j | j  q Wd S(   sN   
        Test that the list for --help-auth does not duplicate items.
        N(   R   t   _checkerFactoriesForOptHelpAutht   assertNotInR   t   append(   R   t	   authTypesR   t   cf(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt!   test_listDoesNotDisplayDuplicates  s
    	c         C   sk   t  j    } t   } | | _ |  j t | j d g  x- t j   D] } |  j | j	 | j
    qD Wd S(   s   
        Test that the --help-auth argument correctly displays all
        available authentication plugins, then exits.
        s   --help-authN(   Ry   R   t
   authOutputR   t
   SystemExitR   R   R   R!   R   R{   (   R   t	   newStdoutR   t   checkerFactory(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_displaysListCorrectly  s    		c         C   s   t  j    } t   } | | _ |  j t | j d d g  x? t j j D]1 } | j	   rG |  j
 | j	   | j    qG qG Wd S(   s   
        Test that the --help-auth-for argument will correctly display
        the help file for a particular authentication plugin.
        s   --help-auth-typeR%   N(   Ry   R   R   R   R   R   R   R'   t   authHelpt   stripR!   R{   (   R   R   R   t   line(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_displaysHelpCorrectly  s    		c         C   sD   t    } |  j t j | j d d g  } |  j t |  d  d S(   s   
        When the checker specified by --auth raises an unexpected error, it
        should be caught and re-raised within a L{usage.UsageError}.
        s   --authR%   s,   Unexpected error: 'file' requires a filenameN(   R   R   R   R   R   R>   t   str(   R   R   t   err(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_unexpectedException  s
    	(
   R   R   R   R   R   R   R   R   R   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR   [  s   							t   OptionsForUsernamePasswordc           B   s   e  Z e j f Z RS(    (   R   R   R   R9   t   supportedInterfaces(    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR     s   t    OptionsForUsernameHashedPasswordc           B   s   e  Z e j f Z RS(    (   R   R   R   t   IUsernameHashedPasswordR   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR     s   t   OptionsSupportsAllInterfacesc           B   s   e  Z d  Z RS(   N(   R   R   Rd   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR     s   t   OptionsSupportsNoInterfacesc           B   s   e  Z g  Z RS(    (   R   R   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR     s   t   TestLimitingInterfacesc           B   sh   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z RS(   s  
    Tests functionality that allows an application to limit the
    credential interfaces it can support. For the purposes of this
    test, we use IUsernameHashedPassword, although this will never
    really be used by the command line.

    (I have, to date, not thought of a half-decent way for a user to
    specify a hash algorithm via the command-line. Nor do I think it's
    very useful.)

    I should note that, at first, this test is counter-intuitive,
    because we're using the checker with a pre-defined hash function
    as the 'bad' checker. See the documentation for
    L{twisted.cred.checkers.FilePasswordDB.hash} for more details.
    c         C   sn   |  j    |  _ t |  j d  j d  t j |  j  |  _ t j |  j d |  j |  _ t j	   |  _
 d  S(   Nt   ws   admin:asdf
alice:foo
t   hash(   Rl   Rm   R%   t   writeR   t   FilePasswordDBt   goodCheckert   _hasht
   badCheckert   AllowAnonymousAccesst   anonChecker(   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR5     s
    c         C   s   | S(   s>   
        A dumb hash that doesn't really do anything.
        (    (   R   t   networkUsernamet   networkPasswordt   storedPassword(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR     s    c         C   s[   t    } |  j | j t j   |  j | j t j   |  j t j	 | j
 |  j  d S(   sO   
        Test that the supportsInterface method behaves appropriately.
        N(   R   R6   t   supportsInterfaceR   R9   t   assertFalseRJ   R   R   t   UnsupportedInterfacest
   addCheckerR   (   R   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_supportsInterface  s    	c         C   s?   t    } |  j | j t j   |  j | j t j   d S(   s   
        Test that the supportsInterface method behaves appropriately
        when the supportedInterfaces attribute is None.
        N(   R   R6   R   R   R9   RJ   (   R   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_supportsAllInterfaces  s
    	c         C   sK   t    } t j } t j } |  j | j |   |  j | j |   d S(   sT   
        Test that the supportsCheckerFactory method behaves appropriately.
        N(   R   R   R'   R   t   theAnonymousCheckerFactoryR6   t   supportsCheckerFactoryR   (   R   R   t   fileCFt   anonCF(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_supportsCheckerFactory  s
    			c         C   s   t    } | j |  j  | j d } |  j | d | d |  j  |  j | d d |  j  |  j t | d |  d  |  j t | d  d  d S(   s   
        Test that when addChecker is called with a checker that
        implements at least one of the interfaces our application
        supports, it is successful.
        i    R   R   i   N(   R   R   R   R   R&   R>   R   (   R   R   t   iface(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_canAddSupportedChecker(  s    	c         C   s)   t    } |  j t j | j |  j  d S(   s   
        Test that when addChecker is called with a checker that does
        not implement any supported interfaces, it fails.
        N(   R   R   R   R   R   R   (   R   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt#   test_failOnAddingUnsupportedChecker9  s    	c         C   s8   t    } t j j } |  j t j | j d | g  d S(   sx   
        Test that the --auth command line raises an exception when it
        gets a checker we don't support.
        s   --authN(   R   R   R   R   R   R   R   R   (   R   R   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_unsupportedInterfaceErrorC  s
    	c         C   sk   t    } x[ | j   D]M } t } x) | j D] } | j |  r, t } q, q, W| r t j    q q Wd S(   s   
        Test that --help-auth will only list checkers that purport to
        supply at least one of the credential interfaces our
        application can use.
        N(   R   R   t   TrueR:   R   t   FalseR   R   (   R   R   R   t   invalidt	   interface(    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_helpAuthLimitsOutputO  s    	c         C   s   t    } d } x- t j   D] } | j |  s | } Pq q W|  j | d  t j   } | | _ |  j t	 | j
 d d g  |  j t j | j    d S(   s   
        Test that --help-auth-type will display a warning if you get
        help for an authType that does not supply at least one of the
        credential interfaces our application can use.
        s   --help-auth-typeRI   N(   R   Rd   R   R   R   t   assertNotIdenticalRy   R   R   R   R   R!   t   notSupportedWarningR{   (   R   R   t   invalidFactoryR   R   (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   test_helpAuthTypeLimitsOutput_  s    		(   R   R   R   R5   R   R   R   R   R   R   R   R   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyR     s   							
		(+   R   Ro   Ry   t   twistedR    t   twisted.trialR   t   twisted.credR   R   R   R   t   twisted.pluginsR   R   t   twisted.pythonR   t   twisted.python.filepathR	   t   twisted.python.fakepwdR
   RQ   t   ImportErrorRd   RV   RZ   R   t   TestCaseR   R   R)   RH   RP   Rk   t   Optionst   AuthOptionMixinR   R   R   R   R   R   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/twisted/test/test_strcred.pyt   <module>   sF   "


	9XQu