예제 #1
0
    def testCopyHash(self):
        import copy
        s = oidutil.Symbol("Foo")
        d = {s: 1}
        d_prime = copy.deepcopy(d)
        self.assertIn(s, d_prime, "%r isn't in %r" % (s, d_prime))

        t = oidutil.Symbol("Bar")
        self.assertNotEqual(hash(s), hash(t))
    def testCopyHash(self):
        import copy
        s = oidutil.Symbol("Foo")
        d = {s: 1}
        d_prime = copy.deepcopy(d)
        self.failUnless(s in d_prime, "%r isn't in %r" % (s, d_prime))

        t = oidutil.Symbol("Bar")
        self.failIfEqual(hash(s), hash(t))
예제 #3
0
# This doesn't REALLY belong here, but where is better?
IDENTIFIER_SELECT = 'http://specs.openid.net/auth/2.0/identifier_select'

# URI for Simple Registration extension, the only commonly deployed
# OpenID 1.x extension, and so a special case
SREG_URI = 'http://openid.net/sreg/1.0'

# The OpenID 1.X namespace URI
OPENID1_NS = 'http://openid.net/signon/1.0'

# The OpenID 2.0 namespace URI
OPENID2_NS = 'http://specs.openid.net/auth/2.0'

# The namespace consisting of pairs with keys that are prefixed with
# "openid."  but not in another namespace.
NULL_NAMESPACE = oidutil.Symbol('Null namespace')

# The null namespace, when it is an allowed OpenID namespace
OPENID_NS = oidutil.Symbol('OpenID namespace')

# The top-level namespace, excluding all pairs with keys that start
# with "openid."
BARE_NS = oidutil.Symbol('Bare namespace')

# Limit, in bytes, of identity provider and return_to URLs, including
# response payload.  See OpenID 1.1 specification, Appendix D.
OPENID1_URL_LIMIT = 2047

# All OpenID protocol fields.  Used to check namespace aliases.
OPENID_PROTOCOL_FIELDS = [
    'ns',
 def test_selfEquality(self):
     s = oidutil.Symbol('xxx')
     self.failUnlessEqual(s, s)
 def test_ne_inequality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('yyy')
     self.failUnless(x != y)
 def test_otherInequality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('xxx')
     self.failIf(x != y)
 def test_selfInequality(self):
     x = oidutil.Symbol('xxx')
     self.failIf(x != x)
 def test_inequality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('yyy')
     self.failIfEqual(x, y)
 def test_otherEquality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('xxx')
     self.failUnlessEqual(x, y)
예제 #10
0
 def test_selfEquality(self):
     s = oidutil.Symbol('xxx')
     self.assertEqual(s, s)
예제 #11
0
# URI for Simple Registration extension, the only commonly deployed
# OpenID 1.x extension, and so a special case
SREG_URI = "http://openid.net/sreg/1.0"

# The OpenID 1.X namespace URI
OPENID1_NS = "http://openid.net/signon/1.0"
THE_OTHER_OPENID1_NS = "http://openid.net/signon/1.1"

OPENID1_NAMESPACES = OPENID1_NS, THE_OTHER_OPENID1_NS

# The OpenID 2.0 namespace URI
OPENID2_NS = "http://specs.openid.net/auth/2.0"

# The namespace consisting of pairs with keys that are prefixed with
# "openid."  but not in another namespace.
NULL_NAMESPACE = oidutil.Symbol("Null namespace")

# The null namespace, when it is an allowed OpenID namespace
OPENID_NS = oidutil.Symbol("OpenID namespace")

# The top-level namespace, excluding all pairs with keys that start
# with "openid."
BARE_NS = oidutil.Symbol("Bare namespace")

# Limit, in bytes, of identity provider and return_to URLs, including
# response payload.  See OpenID 1.1 specification, Appendix D.
OPENID1_URL_LIMIT = 2047

# All OpenID protocol fields.  Used to check namespace aliases.
OPENID_PROTOCOL_FIELDS = [
    "ns",
예제 #12
0
 def test_ne_inequality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('yyy')
     self.assertNotEqual(x, y)
예제 #13
0
 def test_otherInequality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('xxx')
     self.assertFalse(x != y)
예제 #14
0
 def test_selfInequality(self):
     x = oidutil.Symbol('xxx')
     self.assertFalse(x != x)
예제 #15
0
 def test_otherEquality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('xxx')
     self.assertEqual(x, y)
예제 #16
0
 def test_ne_inequality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('yyy')
     self.assertTrue(x != y)