From dbc4716b485839fec4b19d6dadebeafb2eea9aec Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 14 Aug 2020 17:54:38 +0200 Subject: [PATCH] Fix tests --- test/src/ldap_server.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/src/ldap_server.py b/test/src/ldap_server.py index e34f6f38..86a687f8 100644 --- a/test/src/ldap_server.py +++ b/test/src/ldap_server.py @@ -103,7 +103,6 @@ class LDAPServer: ldap_interface.update("cn=admin", admin_dict) - def _hash_user_password(self, password): """ Copy pasta of what's in yunohost/user.py @@ -112,8 +111,10 @@ class LDAPServer: import random import crypt - char_set = string.ascii_uppercase + string.ascii_lowercase + string.digits + "./" - salt = ''.join([random.SystemRandom().choice(char_set) for x in range(16)]) + char_set = ( + string.ascii_uppercase + string.ascii_lowercase + string.digits + "./" + ) + salt = "".join([random.SystemRandom().choice(char_set) for x in range(16)]) - salt = '$6$' + salt + '$' - return '{CRYPT}' + crypt.crypt(str(password), salt) + salt = "$6$" + salt + "$" + return "{CRYPT}" + crypt.crypt(str(password), salt)