incubator-heraldry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ket...@apache.org
Subject svn commit: r493391 - in /incubator/heraldry/libraries/python/openid/trunk/openid/test: test_association.py test_server.py
Date Sat, 06 Jan 2007 05:27:18 GMT
Author: keturn
Date: Fri Jan  5 21:27:18 2007
New Revision: 493391

URL: http://svn.apache.org/viewvc?view=rev&rev=493391
Log:
[python-to-heraldry @ Make tests use cryptutil.SHA256_AVAILABLE]

Original author: cygnus@janrain.com
Date: 2006-12-27 22:30:02+00:00

Modified:
    incubator/heraldry/libraries/python/openid/trunk/openid/test/test_association.py
    incubator/heraldry/libraries/python/openid/trunk/openid/test/test_server.py

Modified: incubator/heraldry/libraries/python/openid/trunk/openid/test/test_association.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/openid/trunk/openid/test/test_association.py?view=diff&rev=493391&r1=493390&r2=493391
==============================================================================
--- incubator/heraldry/libraries/python/openid/trunk/openid/test/test_association.py (original)
+++ incubator/heraldry/libraries/python/openid/trunk/openid/test/test_association.py Fri Jan
 5 21:27:18 2007
@@ -5,16 +5,8 @@
 from openid.message import Message, BARE_NS, OPENID_NS, OPENID2_NS
 from openid import association
 import time
-
-try:
-    from openid import cryptutil
-    cryptutil.sha256('')
-except NotImplementedError:
-    import warnings
-    warnings.warn("Not running SHA256 tests.")
-    has_sha256 = False
-else:
-    has_sha256 = True
+from openid import cryptutil
+import warnings
 
 class AssociationSerializationTest(unittest.TestCase):
     def test_roundTrip(self):
@@ -125,7 +117,7 @@
         sig = assoc.sign(self.pairs)
         self.failUnlessEqual(sig, expected)
 
-    if has_sha256:
+    if cryptutil.SHA256_AVAILABLE:
         def test_sha256(self):
             assoc = association.Association.fromExpiresIn(
                 3600, '{sha256SA}', 'very_secret', "HMAC-SHA256")
@@ -157,7 +149,7 @@
         self.failUnlessEqual(signed.getArg(BARE_NS, "xey"), "value",
                              signed)
 
-    if has_sha256:
+    if cryptutil.SHA256_AVAILABLE:
         def test_signSHA256(self):
             assoc = association.Association.fromExpiresIn(
                 3600, '{sha1}', 'very_secret', "HMAC-SHA256")

Modified: incubator/heraldry/libraries/python/openid/trunk/openid/test/test_server.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/openid/trunk/openid/test/test_server.py?view=diff&rev=493391&r1=493390&r2=493391
==============================================================================
--- incubator/heraldry/libraries/python/openid/trunk/openid/test/test_server.py (original)
+++ incubator/heraldry/libraries/python/openid/trunk/openid/test/test_server.py Fri Jan  5
21:27:18 2007
@@ -802,9 +802,7 @@
         self.failUnlessEqual(secret, self.assoc.secret)
 
 
-    try:
-        cryptutil.sha256('')
-    except NotImplementedError:
+    if not cryptutil.SHA256_AVAILABLE:
         warnings.warn("Not running SHA256 tests.")
     else:
         def test_dhSHA256(self):
@@ -1031,9 +1029,7 @@
         self.failUnlessEqual(response.fields.getArg(OPENID_NS, "session_type"),
                              'DH-SHA256')
 
-    try:
-        cryptutil.sha256('')
-    except NotImplementedError:
+    if not cryptutil.SHA256_AVAILABLE:
         warnings.warn("Not running SHA256 tests.")
     else:
         def test_associate4(self):



Mime
View raw message