Skip to content

Commit

Permalink
fix: missing crypt in python with hypothesis testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
rouilj committed Apr 20, 2024
1 parent 16800af commit 76c568f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/test_hypothesis.py
Expand Up @@ -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:
Expand Down

0 comments on commit 76c568f

Please sign in to comment.