Permalink
Browse files

Adding tests

  • Loading branch information...
1 parent 7e27268 commit 7a9a4de5c0c4e8dc6576f984815fda5e28b773b1 @kudos committed Oct 23, 2012
Showing with 32 additions and 0 deletions.
  1. +9 −0 .travis.yml
  2. +2 −0 requirements.txt
  3. +21 −0 tests.py
View
@@ -0,0 +1,9 @@
+language: python
+python:
+ - "2.5"
+ - "2.6"
+ - "2.7"
+ - "3.2"
+install:
+ - pip install -r requirements.txt --use-mirrors
+script: nosetests
View
@@ -0,0 +1,2 @@
+nose
+py-bcrypt
View
@@ -0,0 +1,21 @@
+from passwords import hash, verify
+
+
+def test_pbkdf2_valid():
+ hashed = hash('test1')
+ assert verify('test1', hashed)
+
+
+def test_pbkdf2_invalid():
+ hashed = hash('test1')
+ assert not verify('test2', hashed)
+
+
+def test_bcrypt_valid():
+ hashed = hash('test1', "bcrypt", 12)
+ assert verify('test1', hashed)
+
+
+def test_bcrypt_invalid():
+ hashed = hash('test1', "bcrypt", 12)
+ assert not verify('test2', hashed)

0 comments on commit 7a9a4de

Please sign in to comment.