1 from openid import message
2 from openid import oidutil
3
6 if ns is None:
7 ns = message.OPENID_NS
8
9 actual = msg.getArg(ns, key)
10 error_format = 'Wrong value for openid.%s: expected=%s, actual=%s'
11 error_message = error_format % (key, expected, actual)
12 self.failUnlessEqual(expected, actual, error_message)
13
15 if ns is None:
16 ns = message.OPENID_NS
17
18 actual = msg.getArg(ns, key)
19 error_message = 'openid.%s unexpectedly present: %s' % (key, actual)
20 self.failIf(actual is not None, error_message)
21
27
30
33
35 """
36 Check that the log messages contained in self.messages have
37 prefixes in *prefixes. Raise AssertionError if not, or if the
38 number of prefixes is different than the number of log
39 messages.
40 """
41 assert len(prefixes) == len(self.messages), \
42 "Expected log prefixes %r, got %r" % (prefixes,
43 self.messages)
44
45 for prefix, message in zip(prefixes, self.messages):
46 assert message.startswith(prefix), \
47 "Expected log prefixes %r, got %r" % (prefixes,
48 self.messages)
49
52