changeset 589:accc2bfda374 pytest2

test added for Tokens in test_crypto.py
author pkumar <contactprashantat@gmail.com>
date Sat, 25 Jun 2011 10:21:47 +0530
parents 36c443f4b37f
children aec005cc5725
files MoinMoin/util/_tests/test_crypto.py
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/_tests/test_crypto.py	Sat Jun 25 09:59:11 2011 +0530
+++ b/MoinMoin/util/_tests/test_crypto.py	Sat Jun 25 10:21:47 2011 +0530
@@ -58,6 +58,15 @@
         hash_val = crypto.crypt_password(u"MoinMoin", salt='12345')
         result = crypto.valid_password(u'MoinMoin', hash_val)
         assert result
-        
+
+class TestToken(object):
+    """ tests for the generated tokens """
+
+    def testvalidtoken(self):
+        """ validate the token """
+        test_key, test_token = crypto.generate_token(key='MoinMoin')
+        result = crypto.valid_token(test_key, test_token)
+        assert result
+       
 coverage_modules = ['MoinMoin.util.crypto']