getting file size for all dict files to be downloaded. coming to be 400mb or so.
[worddb.git] / libs / openid / test / test_extension.py
blob7dadbd0bb5d76afa758d906da8ec7b1020f64c6e
1 from openid import extension
2 from openid import message
4 import unittest
6 class DummyExtension(extension.Extension):
7 ns_uri = 'http://an.extension/'
8 ns_alias = 'dummy'
10 def getExtensionArgs(self):
11 return {}
13 class ToMessageTest(unittest.TestCase):
14 def test_OpenID1(self):
15 oid1_msg = message.Message(message.OPENID1_NS)
16 ext = DummyExtension()
17 ext.toMessage(oid1_msg)
18 namespaces = oid1_msg.namespaces
19 self.failUnless(namespaces.isImplicit(DummyExtension.ns_uri))
20 self.failUnlessEqual(
21 DummyExtension.ns_uri,
22 namespaces.getNamespaceURI(DummyExtension.ns_alias))
23 self.failUnlessEqual(DummyExtension.ns_alias,
24 namespaces.getAlias(DummyExtension.ns_uri))
26 def test_OpenID2(self):
27 oid2_msg = message.Message(message.OPENID2_NS)
28 ext = DummyExtension()
29 ext.toMessage(oid2_msg)
30 namespaces = oid2_msg.namespaces
31 self.failIf(namespaces.isImplicit(DummyExtension.ns_uri))
32 self.failUnlessEqual(
33 DummyExtension.ns_uri,
34 namespaces.getNamespaceURI(DummyExtension.ns_alias))
35 self.failUnlessEqual(DummyExtension.ns_alias,
36 namespaces.getAlias(DummyExtension.ns_uri))