summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2012-04-09 15:29:44 -0400
committerEli Collins <elic@assurancetechnologies.com>2012-04-09 15:29:44 -0400
commit34f766f4a2f11b19ce233e136e435c131531e42c (patch)
tree8f9a0ffd3f091c2e14b2447093e6faf1791b710b /admin
parentba4550d9dc9d12bf3ee714fb05040ebbf4adb8e8 (diff)
downloadpasslib-34f766f4a2f11b19ce233e136e435c131531e42c.tar.gz
removed default policy file & object
was using default policy to store recommended defaults for hashes, but it only affects CryptContext objects, and users seem to frequent using the handler objects directly - so going to store recommended defaults in the handler from now on.
Diffstat (limited to 'admin')
-rw-r--r--admin/benchmarks.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/admin/benchmarks.py b/admin/benchmarks.py
index f2f89e2..45756d5 100644
--- a/admin/benchmarks.py
+++ b/admin/benchmarks.py
@@ -4,10 +4,11 @@ this is a *very* rough benchmark script hacked together when the context
parsing was being sped up. it could definitely be improved.
"""
#=============================================================================
-# init app env
+# init script env
#=============================================================================
import os, sys
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.path.pardir))
+root_dir = os.path.join(os.path.dirname(__file__), os.path.pardir)
+sys.path.insert(0, root_dir)
#=============================================================================
# imports
@@ -66,16 +67,15 @@ class AnotherHandler(BlankHandler):
#=============================================================================
def setup_policy():
import os
- from passlib.context import _load_default_policy, CryptPolicy, \
- __file__ as mpath
- cpath = os.path.abspath(os.path.join(os.path.dirname(mpath), "default.cfg"))
+ from passlib.context import CryptPolicy
+ test_path = os.path.join(root_dir, "passlib", "tests", "sample_config_1s.cfg")
def test_policy_creation():
- with open(cpath, "rb") as fh:
+ with open(test_path, "rb") as fh:
policy1 = CryptPolicy.from_string(fh.read())
yield test_policy_creation
- default = _load_default_policy()
+ default = CryptPolicy.from_path(test_path)
def test_policy_composition():
policy2 = default.replace(
schemes = [ "sha512_crypt", "sha256_crypt", "md5_crypt",