From 76c568f5732e7afd570d0e1ef76d0bf64eac6446 Mon Sep 17 00:00:00 2001 From: John Rouillard Date: Sat, 20 Apr 2024 17:14:08 -0400 Subject: [PATCH] fix: missing crypt in python with hypothesis testing. --- test/test_hypothesis.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/test_hypothesis.py b/test/test_hypothesis.py index 9598a920..dd42791b 100644 --- a/test/test_hypothesis.py +++ b/test/test_hypothesis.py @@ -49,12 +49,15 @@ def test_h64encode_h64decode(self, s): self.assertEqual(h64decode(h64encode(s)), s) + crypt_modes = ["PBKDF2S5", "PBKDF2", "SSHA", "SHA", "MD5", + "plaintext", "zot"] + if crypt_method: + crypt_modes.append("crypt") + @given(one_of(none(), text()), - sampled_from(("PBKDF2S5", "PBKDF2", "SSHA", - "SHA", "MD5", "crypt", "plaintext", - "zot"))) + sampled_from(crypt_modes)) @example("asd\x00df", "crypt") - @settings(max_examples=_max_examples) + @settings(max_examples=_max_examples) # deadline=None for debugging def test_encodePassword(self, password, scheme): if scheme == "crypt" and password and "\x00" in password: