ó
ù2¢\c           @   sS   d  d l  m Z m Z m Z d d l j Z d „  Z d „  Z d „  Z	 d „  Z
 d S(   i   (   t   passwdt   passwd_checkt   salt_leniÿÿÿÿNc          C   sd   t  d ƒ }  |  j d ƒ \ } } } t j | d ƒ t j t | ƒ t ƒ t j t | ƒ d ƒ d  S(   Nt
   passphraset   :t   sha1i(   (   R    t   splitt   ntt   assert_equalt   lenR   (   t   pt	   algorithmt   saltt   hashed(    (    s@   lib/python2.7/site-packages/notebook/auth/tests/test_security.pyt   test_passwd_structure   s
    c          C   s)   t  d ƒ }  t j t |  d ƒ t ƒ d  S(   NR   (   R    R   R   R   t   True(   R
   (    (    s@   lib/python2.7/site-packages/notebook/auth/tests/test_security.pyt   test_roundtrip   s    c          C   s[   t  d ƒ }  t j t |  |  ƒ t ƒ t j t |  d ƒ t ƒ t j t |  d ƒ t ƒ d  S(   NR   s   a:b:c:ds   a:b(   R    R   R   R   t   False(   R
   (    (    s@   lib/python2.7/site-packages/notebook/auth/tests/test_security.pyt   test_bad   s    c          C   s   d }  t  |  d ƒ s t ‚ d  S(   Nu:   sha1:23862bc21dd3:7a415a95ae4580582e314072143d9c382c491e4fu   Å‚eÂ¶Å§â†â†“â†’(   R   t   AssertionError(   t   phash(    (    s@   lib/python2.7/site-packages/notebook/auth/tests/test_security.pyt   test_passwd_check_unicode   s    (   t   securityR    R   R   t
   nose.toolst   toolsR   R   R   R   R   (    (    (    s@   lib/python2.7/site-packages/notebook/auth/tests/test_security.pyt   <module>   s
   			