From 0675d1fec7bbc21e19d0abc8511e3766866114e3 Mon Sep 17 00:00:00 2001 From: Marek Czernek Date: Wed, 17 Jul 2024 16:21:11 +0200 Subject: [PATCH] Remove passlib assumption from pycrypto tests --- tests/pytests/unit/utils/test_pycrypto.py | 25 +++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/pytests/unit/utils/test_pycrypto.py b/tests/pytests/unit/utils/test_pycrypto.py index 1dfcf9621c4..9dff08f883e 100644 --- a/tests/pytests/unit/utils/test_pycrypto.py +++ b/tests/pytests/unit/utils/test_pycrypto.py @@ -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")