summaryrefslogtreecommitdiff
path: root/passlib/tests
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2012-02-08 23:25:45 -0500
committerEli Collins <elic@assurancetechnologies.com>2012-02-08 23:25:45 -0500
commit4712bcd50e12e8ed2e8c135d88ed49951dd45bdf (patch)
treeba00b4a8b0f6fb28c8659c26dab94880dc93cc65 /passlib/tests
parentbf927985d1fe8df1b6a1cb9db4c314bf4c4c13af (diff)
downloadpasslib-4712bcd50e12e8ed2e8c135d88ed49951dd45bdf.tar.gz
renamed passlib.exc warning classes
Diffstat (limited to 'passlib/tests')
-rw-r--r--passlib/tests/test_context.py16
-rw-r--r--passlib/tests/test_utils_handlers.py10
-rw-r--r--passlib/tests/utils.py4
3 files changed, 15 insertions, 15 deletions
diff --git a/passlib/tests/test_context.py b/passlib/tests/test_context.py
index 2ee966a..9d96a0f 100644
--- a/passlib/tests/test_context.py
+++ b/passlib/tests/test_context.py
@@ -18,7 +18,7 @@ except ImportError:
#pkg
from passlib import hash
from passlib.context import CryptContext, CryptPolicy, LazyCryptContext
-from passlib.exc import PasslibContextWarning
+from passlib.exc import PasslibConfigWarning
from passlib.utils import tick, to_bytes, to_unicode
from passlib.utils.compat import irange, u
import passlib.utils.handlers as uh
@@ -622,8 +622,8 @@ class CryptContextTest(TestCase):
# set below handler min
c2 = cc.replace(all__min_rounds=500, all__max_rounds=None,
all__default_rounds=500)
- self.assertWarningMatches(wlog.pop(), category=PasslibContextWarning)
- self.assertWarningMatches(wlog.pop(), category=PasslibContextWarning)
+ self.assertWarningMatches(wlog.pop(), category=PasslibConfigWarning)
+ self.assertWarningMatches(wlog.pop(), category=PasslibConfigWarning)
self.assertEqual(c2.genconfig(salt="nacl"), "$5$rounds=1000$nacl$")
self.assertNoWarnings(wlog)
@@ -632,7 +632,7 @@ class CryptContextTest(TestCase):
cc.genconfig(rounds=1999, salt="nacl"),
'$5$rounds=2000$nacl$',
)
- self.assertWarningMatches(wlog.pop(), category=PasslibContextWarning)
+ self.assertWarningMatches(wlog.pop(), category=PasslibConfigWarning)
self.assertNoWarnings(wlog)
# equal
@@ -654,8 +654,8 @@ class CryptContextTest(TestCase):
# set above handler max
c2 = cc.replace(all__max_rounds=int(1e9)+500, all__min_rounds=None,
all__default_rounds=int(1e9)+500)
- self.assertWarningMatches(wlog.pop(), category=PasslibContextWarning)
- self.assertWarningMatches(wlog.pop(), category=PasslibContextWarning)
+ self.assertWarningMatches(wlog.pop(), category=PasslibConfigWarning)
+ self.assertWarningMatches(wlog.pop(), category=PasslibConfigWarning)
self.assertEqual(c2.genconfig(salt="nacl"),
"$5$rounds=999999999$nacl$")
self.assertNoWarnings(wlog)
@@ -665,7 +665,7 @@ class CryptContextTest(TestCase):
cc.genconfig(rounds=3001, salt="nacl"),
'$5$rounds=3000$nacl$'
)
- self.assertWarningMatches(wlog.pop(), category=PasslibContextWarning)
+ self.assertWarningMatches(wlog.pop(), category=PasslibConfigWarning)
self.assertNoWarnings(wlog)
# equal
@@ -818,7 +818,7 @@ class CryptContextTest(TestCase):
cc.encrypt("password", rounds=1999, salt="nacl"),
'$5$rounds=2000$nacl$9/lTZ5nrfPuz8vphznnmHuDGFuvjSNvOEDsGmGfsS97',
)
- self.assertWarningMatches(wlog.pop(), category=PasslibContextWarning)
+ self.assertWarningMatches(wlog.pop(), category=PasslibConfigWarning)
self.assertFalse(wlog)
self.assertEqual(
diff --git a/passlib/tests/test_utils_handlers.py b/passlib/tests/test_utils_handlers.py
index def6d3e..148228b 100644
--- a/passlib/tests/test_utils_handlers.py
+++ b/passlib/tests/test_utils_handlers.py
@@ -13,7 +13,7 @@ import warnings
from passlib.hash import ldap_md5, sha256_crypt
from passlib.registry import _unload_handler_name as unload_handler_name, \
register_crypt_handler, get_crypt_handler
-from passlib.exc import MissingBackendError, PasslibHandlerWarning
+from passlib.exc import MissingBackendError, PasslibHashWarning
from passlib.utils import getrandstr, JYTHON, rng, to_unicode
from passlib.utils.compat import b, bytes, bascii_to_str, str_to_uascii, \
uascii_to_str, unicode, PY_MAX_25
@@ -191,7 +191,7 @@ class SkeletonTest(TestCase):
self.assertNoWarnings(wlog)
self.assertEqual(norm_salt(salt='aaaabb', relaxed=True), 'aaaa')
- self.assertWarningMatches(wlog.pop(0), category=PasslibHandlerWarning)
+ self.assertWarningMatches(wlog.pop(0), category=PasslibHashWarning)
self.assertNoWarnings(wlog)
#check generated salts
@@ -213,7 +213,7 @@ class SkeletonTest(TestCase):
self.assertNoWarnings(wlog)
self.assertIn(gen_salt(5, relaxed=True), salts4)
- self.assertWarningMatches(wlog.pop(0), category=PasslibHandlerWarning)
+ self.assertWarningMatches(wlog.pop(0), category=PasslibHashWarning)
self.assertNoWarnings(wlog)
# test with max_salt_size=None
@@ -248,7 +248,7 @@ class SkeletonTest(TestCase):
self.assertNoWarnings(wlog)
self.assertEqual(norm_rounds(rounds=0, relaxed=True), 1)
- self.assertWarningMatches(wlog.pop(0), category=PasslibHandlerWarning)
+ self.assertWarningMatches(wlog.pop(0), category=PasslibHashWarning)
self.assertNoWarnings(wlog)
# just right
@@ -262,7 +262,7 @@ class SkeletonTest(TestCase):
self.assertNoWarnings(wlog)
self.assertEqual(norm_rounds(rounds=4, relaxed=True), 3)
- self.assertWarningMatches(wlog.pop(0), category=PasslibHandlerWarning)
+ self.assertWarningMatches(wlog.pop(0), category=PasslibHashWarning)
self.assertNoWarnings(wlog)
# check no default rounds
diff --git a/passlib/tests/utils.py b/passlib/tests/utils.py
index 5a29203..c4019ab 100644
--- a/passlib/tests/utils.py
+++ b/passlib/tests/utils.py
@@ -10,7 +10,7 @@ import re
import os
import sys
import tempfile
-from passlib.exc import PasslibHandlerWarning
+from passlib.exc import PasslibHashWarning
from passlib.utils.compat import PY2, PY27, PY_MIN_32, PY3
try:
@@ -922,7 +922,7 @@ class HandlerCase(TestCase):
if fk:
ctx = catch_warnings()
ctx.__enter__()
- warnings.filterwarnings("ignore", category=PasslibHandlerWarning)
+ warnings.filterwarnings("ignore", category=PasslibHashWarning)
for config, secret, hash in self.known_correct_configs:
result = self.do_genhash(secret, config)
self.assertEqual(result, hash, "config=%r,secret=%r:" % (config,secret))