incubator-heraldry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ket...@apache.org
Subject svn commit: r493382 - /incubator/heraldry/libraries/python/openid/trunk/openid/test/test_auth_request.py
Date Sat, 06 Jan 2007 05:26:38 GMT
Author: keturn
Date: Fri Jan  5 21:26:36 2007
New Revision: 493382

URL: http://svn.apache.org/viewvc?view=rev&rev=493382
Log:
[python-to-heraldry @ Make test_auth_request try immediate mode, too]

Original author: cygnus@janrain.com
Date: 2006-12-27 19:20:35+00:00

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

Modified: incubator/heraldry/libraries/python/openid/trunk/openid/test/test_auth_request.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/openid/trunk/openid/test/test_auth_request.py?view=diff&rev=493382&r1=493381&r2=493382
==============================================================================
--- incubator/heraldry/libraries/python/openid/trunk/openid/test/test_auth_request.py (original)
+++ incubator/heraldry/libraries/python/openid/trunk/openid/test/test_auth_request.py Fri
Jan  5 21:26:36 2007
@@ -26,6 +26,7 @@
     """Mixin for AuthRequest tests for OpenID 1 and 2"""
 
     preferred_namespace = None
+    immediate = False
 
     def setUp(self):
         self.endpoint = DummyEndpoint()
@@ -68,7 +69,8 @@
         self.failUnlessEqual(self.authreq.message.getArgs('bag:'),
                              {'color': 'brown',
                               'material': 'paper'})
-        msg = self.authreq.getMessage(self.realm, self.return_to)
+        msg = self.authreq.getMessage(self.realm, self.return_to,
+                                      self.immediate)
 
         # XXX: this depends on the way that Message assigns
         # namespaces. Really it doesn't care that it has alias "0",
@@ -79,7 +81,8 @@
         self.failUnlessEqual('paper', post_args['openid.0.material'])
 
     def test_standard(self):
-        msg = self.authreq.getMessage(self.realm, self.return_to)
+        msg = self.authreq.getMessage(self.realm, self.return_to,
+                                      self.immediate)
 
         self.failUnlessHasIdentifiers(
             msg, self.endpoint.local_id, self.endpoint.claimed_id)
@@ -90,7 +93,10 @@
         self.failUnlessEqual(self.preferred_namespace,
                              msg.getOpenIDNamespace())
 
-        self.failUnlessOpenIDValueEquals(msg, 'mode', 'checkid_setup')
+        expected_mode = self.immediate and 'checkid_immediate' \
+                        or 'checkid_setup'
+
+        self.failUnlessOpenIDValueEquals(msg, 'mode', expected_mode)
 
 class TestAuthRequestOpenID2(TestAuthRequestBase, unittest.TestCase):
     preferred_namespace = message.OPENID2_NS
@@ -107,23 +113,27 @@
 
     def test_userAnonymousIgnoresIdentfier(self):
         self.authreq.setAnonymous(True)
-        msg = self.authreq.getMessage(self.realm, self.return_to)
+        msg = self.authreq.getMessage(self.realm, self.return_to,
+                                      self.immediate)
         self.failUnlessAnonymous(msg)
 
     def test_opAnonymousIgnoresIdentifier(self):
         self.endpoint.is_op_identifier = True
         self.authreq.setAnonymous(True)
-        msg = self.authreq.getMessage(self.realm, self.return_to)
+        msg = self.authreq.getMessage(self.realm, self.return_to,
+                                      self.immediate)
         self.failUnlessAnonymous(msg)
 
     def test_opIdentifierSendsIdentifierSelect(self):
         self.endpoint.is_op_identifier = True
-        msg = self.authreq.getMessage(self.realm, self.return_to)
+        msg = self.authreq.getMessage(self.realm, self.return_to,
+                                      self.immediate)
         self.failUnlessHasIdentifiers(
             msg, message.IDENTIFIER_SELECT, message.IDENTIFIER_SELECT)
 
     def test_realm(self):
-        msg = self.authreq.getMessage(self.realm, self.return_to)
+        msg = self.authreq.getMessage(self.realm, self.return_to,
+                                      self.immediate)
         self.failIf(msg.getArg(message.OPENID2_NS, 'trust_root'))
         self.failUnlessEqual(self.realm,
                              msg.getArg(message.OPENID2_NS, 'realm'))
@@ -148,13 +158,15 @@
         identifier_select just like OpenID 2.
         """
         self.endpoint.is_op_identifier = True
-        msg = self.authreq.getMessage(self.realm, self.return_to)
+        msg = self.authreq.getMessage(self.realm, self.return_to,
+                                      self.immediate)
         self.failUnlessEqual(message.IDENTIFIER_SELECT,
                              msg.getArg(message.OPENID1_NS, 'identity'))
 
     def test_trustRoot(self):
         """Realm used to be called 'trust_root'"""
-        msg = self.authreq.getMessage(self.realm, self.return_to)
+        msg = self.authreq.getMessage(self.realm, self.return_to,
+                                      self.immediate)
         self.failIf(msg.getArg(message.OPENID1_NS, 'realm'))
         self.failUnlessEqual(self.realm,
                              msg.getArg(message.OPENID1_NS, 'trust_root'))
@@ -163,6 +175,12 @@
         """Make sure claimed_is is *absent* in request."""
         self.failUnlessOpenIDValueEquals(msg, 'identity', op_specific_id)
         self.failIfOpenIDKeyExists(msg, 'claimed_id')
+
+class TestAuthRequestOpenID1Immediate(TestAuthRequestOpenID1):
+    immediate = True
+
+class TestAuthRequestOpenID2Immediate(TestAuthRequestOpenID2):
+    immediate = True
 
 if __name__ == '__main__':
     unittest.main()



Mime
View raw message