diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2012-04-27 03:16:08 -0400 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2012-04-27 03:16:08 -0400 |
| commit | 332d8d949d27b4431ef4d7fb1044b8511a1188cb (patch) | |
| tree | 14a967cb04b5d7f679b7962329e30f3cf68292c0 /admin | |
| parent | 09aa392f4362ac7532184435f9f9f8cd15dc5aba (diff) | |
| download | passlib-332d8d949d27b4431ef4d7fb1044b8511a1188cb.tar.gz | |
assorted small details that weren't covered in the last few merges
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/benchmarks.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/admin/benchmarks.py b/admin/benchmarks.py index 4526a4e..beca3dd 100644 --- a/admin/benchmarks.py +++ b/admin/benchmarks.py @@ -24,7 +24,7 @@ try: except ImportError: PasslibConfigWarning = None import passlib.utils.handlers as uh -from passlib.utils.compat import u, print_, unicode +from passlib.utils.compat import u, print_, unicode, next_method_attr # local #============================================================================= @@ -64,7 +64,7 @@ class benchmark: kwds.update(options) if mode == "ctor": itr = obj() - if not hasattr(itr, "next"): + if not hasattr(itr, next_method_attr): itr = [itr] for func in itr: # TODO: per function name & options @@ -235,6 +235,17 @@ def test_ldap_salted_md5(): handler.verify(OTHER, hash) yield helper +@benchmark.constructor() +def test_phpass(): + "test phpass" + from passlib.hash import phpass as handler + kwds = dict(salt='.'*8, rounds=16) + def helper(): + hash = handler.encrypt(SECRET, **kwds) + handler.verify(SECRET, hash) + handler.verify(OTHER, hash) + yield helper + #============================================================================= # crypto utils #============================================================================= |
