ó
E®Uc           @   sB   d  Z  d d l m Z d d l Z d e j j f d „  ƒ  YZ d S(   s«   Tests for the Credentials Python bindings.

Note that this just tests the bindings work. It does not intend to test
the functionality, that's already done in other tests.
iÿÿÿÿ(   t   credentialsNt   CredentialsTestsc           B   s   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s&   t  t |  ƒ j ƒ  t j ƒ  |  _ d  S(   N(   t   superR   t   setUpR    t   Credentialst   creds(   t   self(    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyR      s    c         C   s-   |  j  j d ƒ |  j d |  j  j ƒ  ƒ d  S(   Nt   somebody(   R   t   set_usernamet   assertEqualst   get_username(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_set_username!   s    c         C   s-   |  j  j d ƒ |  j d |  j  j ƒ  ƒ d  S(   Nt   S3CreT(   R   t   set_passwordR	   t   get_password(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_set_password%   s    c         C   s-   |  j  j d ƒ |  j d |  j  j ƒ  ƒ d  S(   Nt   ABMAS(   R   t
   set_domainR	   t
   get_domain(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_set_domain)   s    c         C   s-   |  j  j d ƒ |  j d |  j  j ƒ  ƒ d  S(   Nt   myrealmt   MYREALM(   R   t	   set_realmR	   t	   get_realm(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_set_realm-   s    c         C   sF   |  j  j d ƒ |  j d |  j  j ƒ  ƒ |  j d  |  j  j ƒ  ƒ d  S(   Nt   %t    (   R   t   parse_stringR	   R
   t   NoneR   (   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_parse_string_anon1   s    c         C   s_   |  j  j d ƒ |  j d |  j  j ƒ  ƒ |  j d |  j  j ƒ  ƒ |  j d |  j  j ƒ  ƒ d  S(   Ns   dom\someone%secrt   someonet   secrt   DOM(   R   R   R	   R
   R   R   (   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt    test_parse_string_user_pw_domain6   s    c         C   sF   |  j  d  |  j j ƒ  ƒ |  j j d ƒ |  j  d |  j j ƒ  ƒ d  S(   Ns   dc=foo,cn=bar(   R	   R   R   t   get_bind_dnt   set_bind_dn(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_bind_dn<   s    c         C   ss   |  j  j d ƒ |  j |  j  j ƒ  ƒ |  j  j d ƒ |  j |  j  j ƒ  ƒ |  j  j ƒ  |  j |  j  j ƒ  ƒ d  S(   NR   R   (   R   R   t
   assertTruet   is_anonymoust   assertFalset   set_anonymous(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_is_anonA   s    c         C   s-   |  j  j d ƒ |  j d |  j  j ƒ  ƒ d  S(   Nt	   myworksta(   R   t   set_workstationR	   t   get_workstation(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_workstationI   s    c         C   s-   |  j  j d ƒ |  j d |  j  j ƒ  ƒ d  S(   Nt   geheims   Â®ææH„cRE>o*ë“(   R   R   R	   t   get_nt_hash(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_get_nt_hashO   s    	c         C   s   |  j  j ƒ  d  S(   N(   R   t   guess(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt
   test_guessT   s    c         C   s   |  j  j ƒ  d  S(   N(   R   t   set_cmdline_callbacks(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_set_cmdline_callbacksX   s    c         C   sP   |  j  j d ƒ |  j |  j  j ƒ  ƒ |  j  j d ƒ |  j |  j  j ƒ  ƒ d  S(   NR   R   (   R   R   R'   t   authentication_requestedR%   (   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_authentication_requested[   s    c         C   s   |  j  |  j j ƒ  ƒ d  S(   N(   R'   R   t   wrong_password(   R   (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   test_wrong_passworda   s    (   t   __name__t
   __module__R   R   R   R   R   R   R!   R$   R)   R-   R0   R2   R4   R6   R8   (    (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyR      s   														(   t   __doc__t   sambaR    t   samba.testst   testst   TestCaseR   (    (    (    s;   /usr/lib/python2.7/dist-packages/samba/tests/credentials.pyt   <module>   s   