incubator-heraldry-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?view=rev&rev=493390
Log:
[python-to-heraldry @ Move generic test support stuff to openid.test.support]

Original author: Josh Hoyt <josh@janrain.com>
Date: 2006-12-27 22:12:42+00:00

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

Added: incubator/heraldry/libraries/python/openid/trunk/openid/test/support.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/openid/trunk/openid/test/support.py?view=auto&rev=493390
==============================================================================
--- incubator/heraldry/libraries/python/openid/trunk/openid/test/support.py (added)
+++ incubator/heraldry/libraries/python/openid/trunk/openid/test/support.py Fri Jan  5 21:27:12
2007
@@ -0,0 +1,20 @@
+from openid import message
+
+class OpenIDTestMixin(object):
+    def failUnlessOpenIDValueEquals(self, msg, key, expected, ns=None):
+        if ns is None:
+            ns = message.OPENID_NS
+
+        actual = msg.getArg(ns, key)
+        error_format = 'Wrong value for openid.%s: expected=%s, actual=%s'
+        error_message = error_format % (key, expected, actual)
+        self.failUnlessEqual(expected, actual, error_message)
+
+    def failIfOpenIDKeyExists(self, msg, key, ns=None):
+        if ns is None:
+            ns = message.OPENID_NS
+
+        actual = msg.getArg(ns, key)
+        error_message = 'openid.%s unexpectedly present: %s' % (key, actual)
+        self.failIf(actual is not None, error_message)
+

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=493390&r1=493389&r2=493390
==============================================================================
--- 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:27:12 2007
@@ -3,6 +3,7 @@
 
 from openid.consumer import consumer
 from openid import message
+from openid.test import support
 
 class DummyEndpoint(object):
     preferred_namespace = None
@@ -22,7 +23,7 @@
 class DummyAssoc(object):
     handle = "assoc-handle"
 
-class TestAuthRequestBase(object):
+class TestAuthRequestMixin(support.OpenIDTestMixin):
     """Mixin for AuthRequest tests for OpenID 1 and 2; DON'T add
     unittest.TestCase as a base class here."""
 
@@ -45,23 +46,6 @@
         for key in ['claimed_id', 'identity']:
             self.failIfOpenIDKeyExists(msg, key)
 
-    def failUnlessOpenIDValueEquals(self, msg, key, expected, ns=None):
-        if ns is None:
-            ns = message.OPENID_NS
-
-        actual = msg.getArg(ns, key)
-        error_format = 'Wrong value for openid.%s: expected=%s, actual=%s'
-        error_message = error_format % (key, expected, actual)
-        self.failUnlessEqual(expected, actual, error_message)
-
-    def failIfOpenIDKeyExists(self, msg, key, ns=None):
-        if ns is None:
-            ns = message.OPENID_NS
-
-        actual = msg.getArg(ns, key)
-        error_message = 'openid.%s unexpectedly present: %s' % (key, actual)
-        self.failIf(actual is not None, error_message)
-
     def failUnlessHasRequiredFields(self, msg):
         self.failUnlessEqual(self.preferred_namespace,
                              self.authreq.message.getOpenIDNamespace())
@@ -118,7 +102,7 @@
         self.failUnlessHasIdentifiers(
             msg, self.endpoint.local_id, self.endpoint.claimed_id)
 
-class TestAuthRequestOpenID2(TestAuthRequestBase, unittest.TestCase):
+class TestAuthRequestOpenID2(TestAuthRequestMixin, unittest.TestCase):
     preferred_namespace = message.OPENID2_NS
 
     def failUnlessHasRealm(self, msg):
@@ -168,7 +152,7 @@
         self.failUnlessHasIdentifiers(
             msg, message.IDENTIFIER_SELECT, message.IDENTIFIER_SELECT)
 
-class TestAuthRequestOpenID1(TestAuthRequestBase, unittest.TestCase):
+class TestAuthRequestOpenID1(TestAuthRequestMixin, unittest.TestCase):
     preferred_namespace = message.OPENID1_NS
 
     def setUpEndpoint(self):



Mime
View raw message