openbsd-ports/sysutils/ansible-core/patches/patch-test_units_utils_test_encrypt_py
2022-03-11 19:57:10 +00:00

40 lines
2.0 KiB
Plaintext

Index: test/units/utils/test_encrypt.py
--- test/units/utils/test_encrypt.py.orig
+++ test/units/utils/test_encrypt.py
@@ -37,7 +37,7 @@ def assert_hash(expected, secret, algorithm, **setting
assert excinfo.value.args[0] == "passlib must be installed and usable to hash with '%s'" % algorithm
-@pytest.mark.skipif(sys.platform.startswith('darwin'), reason='macOS requires passlib')
+@pytest.mark.skipif(sys.platform.startswith(('darwin', 'openbsd')), reason='macOS and OpenBSD require passlib')
def test_encrypt_with_rounds_no_passlib():
with passlib_off():
assert_hash("$5$rounds=5000$12345678$uAZsE3BenI2G.nA8DpTl.9Dc8JiqacI53pEqRr5ppT7",
@@ -76,7 +76,7 @@ def test_encrypt_with_rounds():
secret="123", algorithm="sha512_crypt", salt="12345678", rounds=5000)
-@pytest.mark.skipif(sys.platform.startswith('darwin'), reason='macOS requires passlib')
+@pytest.mark.skipif(sys.platform.startswith(('darwin', 'openbsd')), reason='macOS and OpenBSD require passlib')
def test_encrypt_default_rounds_no_passlib():
with passlib_off():
assert_hash("$1$12345678$tRy4cXc3kmcfRZVj4iFXr/",
@@ -102,7 +102,7 @@ def test_encrypt_default_rounds():
assert encrypt.PasslibHash("md5_crypt").hash("123")
-@pytest.mark.skipif(sys.platform.startswith('darwin'), reason='macOS requires passlib')
+@pytest.mark.skipif(sys.platform.startswith(('darwin', 'openbsd')), reason='macOS and OpenBSD require passlib')
def test_password_hash_filter_no_passlib():
with passlib_off():
assert not encrypt.PASSLIB_AVAILABLE
@@ -139,7 +139,7 @@ def test_password_hash_filter_passlib():
assert get_encrypted_password("123", "pbkdf2_sha256", ident='invalid_ident')
-@pytest.mark.skipif(sys.platform.startswith('darwin'), reason='macOS requires passlib')
+@pytest.mark.skipif(sys.platform.startswith(('darwin', 'openbsd')), reason='macOS and OpenBSD require passlib')
def test_do_encrypt_no_passlib():
with passlib_off():
assert not encrypt.PASSLIB_AVAILABLE