From ceb7a00ddae502624d609bc63a9048f0de9f1b23 Mon Sep 17 00:00:00 2001 From: Eli Collins Date: Tue, 17 Apr 2012 21:55:38 -0400 Subject: a bunch of bugfixes found during unittesting * bsdi_crypt apparently available on openbsd 4.9 * typo fixes * ConfigParser apparently only uses OrderedDict for >= PY27, adjusted CryptContext test accordingly * fixed test that depended on sha256_crypt.default_rounds * handle os_crypt backend w/ no fallback (bcrypt) * let _norm_rounds accept longs --- passlib/tests/test_context_deprecated.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'passlib/tests/test_context_deprecated.py') diff --git a/passlib/tests/test_context_deprecated.py b/passlib/tests/test_context_deprecated.py index df0c5bd..e6aaffa 100644 --- a/passlib/tests/test_context_deprecated.py +++ b/passlib/tests/test_context_deprecated.py @@ -725,9 +725,11 @@ class CryptContextTest(TestCase): # explicit default rounds self.assertEqual(cc.genconfig(salt="nacl"), '$5$rounds=2500$nacl$') - # fallback default rounds - use handler's - c2 = cc.replace(all__default_rounds=None, all__max_rounds=50000) - self.assertEqual(c2.genconfig(salt="nacl"), '$5$rounds=40000$nacl$') + # fallback default rounds - use handler's default + df = hash.sha256_crypt.default_rounds + c2 = cc.copy(all__default_rounds=None, all__max_rounds=df<<1) + self.assertEqual(c2.genconfig(salt="nacl"), + '$5$rounds=%d$nacl$' % df) # fallback default rounds - use handler's, but clipped to max rounds c2 = cc.replace(all__default_rounds=None, all__max_rounds=3000) -- cgit v1.2.1