mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Remove passlib assumption from pycrypto tests
This commit is contained in:
parent
29d4137e0b
commit
0675d1fec7
1 changed files with 12 additions and 13 deletions
|
@ -57,21 +57,20 @@ def test_gen_hash_crypt(algorithm, expected):
|
|||
"""
|
||||
Test gen_hash with crypt library
|
||||
"""
|
||||
with patch("salt.utils.pycrypto.methods", {}):
|
||||
ret = salt.utils.pycrypto.gen_hash(
|
||||
crypt_salt=expected["salt"], password=passwd, algorithm=algorithm
|
||||
)
|
||||
assert ret == expected["hashed"]
|
||||
ret = salt.utils.pycrypto.gen_hash(
|
||||
crypt_salt=expected["salt"], password=passwd, algorithm=algorithm
|
||||
)
|
||||
assert ret == expected["hashed"]
|
||||
|
||||
ret = salt.utils.pycrypto.gen_hash(
|
||||
crypt_salt=expected["badsalt"], password=passwd, algorithm=algorithm
|
||||
)
|
||||
assert ret != expected["hashed"]
|
||||
ret = salt.utils.pycrypto.gen_hash(
|
||||
crypt_salt=expected["badsalt"], password=passwd, algorithm=algorithm
|
||||
)
|
||||
assert ret != expected["hashed"]
|
||||
|
||||
ret = salt.utils.pycrypto.gen_hash(
|
||||
crypt_salt=None, password=passwd, algorithm=algorithm
|
||||
)
|
||||
assert ret != expected["hashed"]
|
||||
ret = salt.utils.pycrypto.gen_hash(
|
||||
crypt_salt=None, password=passwd, algorithm=algorithm
|
||||
)
|
||||
assert ret != expected["hashed"]
|
||||
|
||||
|
||||
@pytest.mark.skipif(not salt.utils.pycrypto.HAS_CRYPT, reason="crypt not available")
|
||||
|
|
Loading…
Add table
Reference in a new issue