Beispiel #1
0
    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))
Beispiel #2
0
 def test_otherEquality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('xxx')
     self.failUnlessEqual(x, y)
Beispiel #3
0
 def test_selfEquality(self):
     s = oidutil.Symbol('xxx')
     self.failUnlessEqual(s, s)
Beispiel #4
0
 def test_ne_inequality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('yyy')
     self.failUnless(x != y)
Beispiel #5
0
 def test_otherInequality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('xxx')
     self.failIf(x != y)
Beispiel #6
0
 def test_selfInequality(self):
     x = oidutil.Symbol('xxx')
     self.failIf(x != x)
Beispiel #7
0
 def test_inequality(self):
     x = oidutil.Symbol('xxx')
     y = oidutil.Symbol('yyy')
     self.failIfEqual(x, y)
Beispiel #8
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',