incubator-heraldry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ket...@apache.org
Subject svn commit: r493358 - in /incubator/heraldry/libraries/python/openid/trunk/openid: message.py test/test_message.py
Date Sat, 06 Jan 2007 05:24:53 GMT
Author: keturn
Date: Fri Jan  5 21:24:51 2007
New Revision: 493358

URL: http://svn.apache.org/viewvc?view=rev&rev=493358
Log:
[python-to-heraldry @ Add isOpenID1 and isOpenID2 methods to message.Message]

Original author: Josh Hoyt <josh@janrain.com>
Date: 2006-12-21 19:25:02+00:00

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

Modified: incubator/heraldry/libraries/python/openid/trunk/openid/message.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/openid/trunk/openid/message.py?view=diff&rev=493358&r1=493357&r2=493358
==============================================================================
--- incubator/heraldry/libraries/python/openid/trunk/openid/message.py (original)
+++ incubator/heraldry/libraries/python/openid/trunk/openid/message.py Fri Jan  5 21:24:51
2007
@@ -172,6 +172,12 @@
     def getOpenIDNamespace(self):
         return self._openid_ns_uri
 
+    def isOpenID1(self):
+        return self.getOpenIDNamespace() == OPENID1_NS
+
+    def isOpenID2(self):
+        return self.getOpenIDNamespace() == OPENID2_NS
+
     def fromKVForm(cls, kvform_string):
         """Create a Message from a KVForm string"""
         return cls.fromOpenIDArgs(kvform.kvToDict(kvform_string))

Modified: incubator/heraldry/libraries/python/openid/trunk/openid/test/test_message.py
URL: http://svn.apache.org/viewvc/incubator/heraldry/libraries/python/openid/trunk/openid/test/test_message.py?view=diff&rev=493358&r1=493357&r2=493358
==============================================================================
--- incubator/heraldry/libraries/python/openid/trunk/openid/test/test_message.py (original)
+++ incubator/heraldry/libraries/python/openid/trunk/openid/test/test_message.py Fri Jan 
5 21:24:51 2007
@@ -189,6 +189,11 @@
     def test_delArgNS3(self):
         self._test_delArgNS('urn:nothing-significant')
 
+    def test_isOpenID1(self):
+        self.failIf(self.msg.isOpenID1())
+
+    def test_isOpenID2(self):
+        self.failIf(self.msg.isOpenID2())
 
 class OpenID1MessageTest(unittest.TestCase):
     def setUp(self):
@@ -379,6 +384,12 @@
         self._test_delArgNS('urn:nothing-significant')
 
 
+    def test_isOpenID1(self):
+        self.failUnless(self.msg.isOpenID1())
+
+    def test_isOpenID2(self):
+        self.failIf(self.msg.isOpenID2())
+
 class OpenID1ExplicitMessageTest(OpenID1MessageTest):
     def setUp(self):
         self.msg = message.Message.fromPostArgs({'openid.mode':'error',
@@ -624,6 +635,12 @@
     def test_argList(self):
         self.failUnlessRaises(TypeError, self.msg.fromPostArgs,
                               {'arg': [1, 2, 3]})
+
+    def test_isOpenID1(self):
+        self.failIf(self.msg.isOpenID1())
+
+    def test_isOpenID2(self):
+        self.failUnless(self.msg.isOpenID2())
 
 class MessageTest(unittest.TestCase):
     def setUp(self):



Mime
View raw message