Skip to content

Commit

Permalink
remove passlib.utils._crypt patching
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirVondukr committed Sep 12, 2024
1 parent 6a4f8a2 commit 981a4b8
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,27 +237,6 @@ def get_hash(secret):
self.assertTrue(test_crypt("test", h1))
self.assertFalse(test_crypt("test", h1x))

# check crypt returning variant error indicators
# some platforms return None on errors, others empty string,
# The BSDs in some cases return ":"
import passlib.utils as mod

orig = mod._crypt
try:
retval = None
mod._crypt = lambda secret, hash: retval

for retval in [None, "", ":", ":0", "*0"]:
self.assertEqual(safe_crypt("test", h1), None)
self.assertFalse(test_crypt("test", h1))

retval = "xxx"
self.assertEqual(safe_crypt("test", h1), "xxx")
self.assertFalse(test_crypt("test", h1))

finally:
mod._crypt = orig

def test_consteq(self):
"""test consteq()"""
# NOTE: this test is kind of over the top, but that's only because
Expand Down

0 comments on commit 981a4b8

Please sign in to comment.