fix some codacy errors

This commit is contained in:
Valentin Samir
2016-07-29 15:11:43 +02:00
parent 3063cf116b
commit 570676f5b0
6 changed files with 28 additions and 11 deletions

View File

@ -136,9 +136,12 @@ class CheckPasswordCase(TestCase):
"""test all the hex_HASH method: the hashed password is a simple hash of the password"""
hashes = ["md5", "sha1", "sha224", "sha256", "sha384", "sha512"]
hashed_password1 = []
for hash in hashes:
for hash_scheme in hashes:
hashed_password1.append(
("hex_%s" % hash, getattr(utils.hashlib, hash)(self.password1).hexdigest())
(
"hex_%s" % hash_scheme,
getattr(utils.hashlib, hash_scheme)(self.password1).hexdigest()
)
)
for (method, hp1) in hashed_password1:
self.assertTrue(utils.check_password(method, self.password1, hp1, "utf8"))