incubator-heraldry-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?view=rev&rev=493392
Log:
[python-to-heraldry @ Make answerUnsupported require message arg, and make tests expect openid.error
in unsupported-type responses]

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

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

Modified: incubator/heraldry/libraries/python/openid/trunk/openid/server/server.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/openid/trunk/openid/server/server.py?view=diff&rev=493392&r1=493391&r2=493392
==============================================================================
--- incubator/heraldry/libraries/python/openid/trunk/openid/server/server.py (original)
+++ incubator/heraldry/libraries/python/openid/trunk/openid/server/server.py Fri Jan  5 21:27:22
2007
@@ -441,14 +441,13 @@
 
         return response
 
-    def answerUnsupported(self, message=None, preferred_association_type=None,
+    def answerUnsupported(self, message, preferred_association_type=None,
                           preferred_session_type=None):
         """Respond to this request indicating that the association
         type or association session type is not supported."""
         response = OpenIDResponse(self)
         response.fields.setArg(OPENID_NS, 'error_code', 'unsupported-type')
-        if message:
-            response.fields.setArg(OPENID_NS, 'error', message)
+        response.fields.setArg(OPENID_NS, 'error', message)
 
         if preferred_association_type:
             response.fields.setArg(

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=493392&r1=493391&r2=493392
==============================================================================
--- 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:22 2007
@@ -959,11 +959,12 @@
         self.failUnlessEqual(rfg('session_type'), allowed_sess)
 
     def test_unsupported(self):
-        response = self.request.answerUnsupported()
+        message = 'This is a unit test'
+        response = self.request.answerUnsupported(message)
         rfg = lambda f: response.fields.getArg(OPENID_NS, f)
         self.failUnlessEqual(rfg('error_code'), 'unsupported-type')
         self.failUnlessEqual(rfg('assoc_type'), None)
-        self.failUnlessEqual(rfg('error'), None)
+        self.failUnlessEqual(rfg('error'), message)
         self.failUnlessEqual(rfg('session_type'), None)
 
 class Counter(object):



Mime
View raw message