Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve PasswordHasher.from_config_file

  • Loading branch information...
commit 0b20858ef65d8f8bc5d1190d8cde6c521c36a4d0 1 parent c20cbab
Daniel Neuhäuser authored
Showing with 15 additions and 3 deletions.
  1. +15 −3 pwhash/tests/test_hashers.py
18 pwhash/tests/test_hashers.py
View
@@ -6,6 +6,8 @@
:copyright: 2013 by Daniel Neuhäuser
:license: BSD, see LICENSE.rst for details
"""
+import os
+
from pwhash import PasswordHasher
from pwhash.hashers import (
BCryptHasher, PBKDF2Hasher, PlainHasher, MD5Hasher, SHA1Hasher,
@@ -209,10 +211,20 @@ def test_from_config(self, recwarn):
assert "pbkdf2" in str(warning.message)
assert not recwarn.list
- def test_from_config_file(self, recwarn):
+ @pytest.mark.parametrize(("path", "importable"), [
+ ("pwhashc.json", __name__),
+ (
+ os.path.join(
+ os.path.abspath(os.path.dirname(__file__)),
+ "pwhashc.json"
+ ),
+ None
+ )
+ ])
+ def test_from_config_file(self, recwarn, path, importable):
hasher = PasswordHasher.from_config_file(
- "pwhashc.json",
- relative_to_importable=__name__
+ path,
+ relative_to_importable=importable
)
assert not recwarn.list # no warnings issued
Please sign in to comment.
Something went wrong with that request. Please try again.