#NEWLINE# def test_hash_password( ) : #NEWLINE# #INDENT# p = 'password' #NEWLINE# auth = authcode . Auth ( SECRET_KEY , hash = 'pbkdf2_sha512' , rounds = 345 ) #NEWLINE# hashed = auth . hash_password ( p ) #NEWLINE# assert hashed . startswith ( '$pbkdf2-sha512$345$' ) #NEWLINE# assert auth . password_is_valid ( p , hashed ) #NEWLINE# assert ( not auth . password_is_valid ( p , 'lalala' ) ) #NEWLINE# assert ( not auth . password_is_valid ( p , None ) ) #NEWLINE# assert ( not auth . password_is_valid ( None , 'lalala' ) ) #NEWLINE# assert ( not auth . password_is_valid ( None , None ) )