changeset 590:aec005cc5725 pytest2

testcache_key added to test_crypto.py
author pkumar <contactprashantat@gmail.com>
date Sat, 25 Jun 2011 10:56:44 +0530
parents accc2bfda374
children bbd6da3dc2f2
files MoinMoin/util/_tests/test_crypto.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/_tests/test_crypto.py	Sat Jun 25 10:21:47 2011 +0530
+++ b/MoinMoin/util/_tests/test_crypto.py	Sat Jun 25 10:56:44 2011 +0530
@@ -67,6 +67,14 @@
         test_key, test_token = crypto.generate_token(key='MoinMoin')
         result = crypto.valid_token(test_key, test_token)
         assert result
-       
+
+    def testcache_key(self):
+        """ The key must be different for different <kw> """
+        test_kw1 = {'MoinMoin': 'value1'}
+        result1 = crypto.cache_key(**test_kw1)
+        test_kw2 = {'Moin2' : 'value2'}
+        result2 = crypto.cache_key(**test_kw2)
+        assert result1 != result1, ("Expected different keys for different <kw> but got the same")
+           
 coverage_modules = ['MoinMoin.util.crypto']