diff options
author | Eli Collins <elic@assurancetechnologies.com> | 2012-04-17 21:55:38 -0400 |
---|---|---|
committer | Eli Collins <elic@assurancetechnologies.com> | 2012-04-17 21:55:38 -0400 |
commit | ceb7a00ddae502624d609bc63a9048f0de9f1b23 (patch) | |
tree | 69a8f42f57c6f39da914a9952cb7e8cf25dff34f /passlib/tests/test_context_deprecated.py | |
parent | 8583409d34d9491553f6c8e545653842518f311c (diff) | |
download | passlib-ceb7a00ddae502624d609bc63a9048f0de9f1b23.tar.gz |
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
Diffstat (limited to 'passlib/tests/test_context_deprecated.py')
-rw-r--r-- | passlib/tests/test_context_deprecated.py | 8 |
1 files changed, 5 insertions, 3 deletions
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) |