Permalink
Browse files

Merge pull request #64 from dairiki/tests

Fixes for failing tests
  • Loading branch information...
2 parents f8e8e8f + 45fe1db commit b1d37696469921f1025395201864842427fc32fb @rodrigoprimo rodrigoprimo committed Jul 14, 2013
Showing with 5 additions and 7 deletions.
  1. +2 −4 openid/test/test_association_response.py
  2. +3 −3 openid/test/test_auth_request.py
@@ -176,7 +176,7 @@ def mkTest(expected_session_type, session_type_value):
"""
def test(self):
self._doTest(expected_session_type, session_type_value)
- self.failUnlessEqual(0, len(self.messages))
+ self.failUnlessLogEmpty()
return test
@@ -214,9 +214,7 @@ def test_explicitNoEncryption(self):
session_type_value='no-encryption',
expected_session_type='no-encryption',
)
- self.failUnlessEqual(1, len(self.messages))
- self.failUnless(self.messages[0].startswith(
- 'WARNING: OpenID server sent "no-encryption"'))
+ self.failUnlessLogMatches('OpenID server sent "no-encryption"')
test_dhSHA1 = mkTest(
session_type_value='DH-SHA1',
@@ -23,7 +23,7 @@ def isOPIdentifier(self):
class DummyAssoc(object):
handle = "assoc-handle"
-class TestAuthRequestMixin(support.OpenIDTestMixin):
+class AuthRequestTestMixin(support.OpenIDTestMixin):
"""Mixin for AuthRequest tests for OpenID 1 and 2; DON'T add
unittest.TestCase as a base class here."""
@@ -101,7 +101,7 @@ def test_standard(self):
self.failUnlessHasIdentifiers(
msg, self.endpoint.local_id, self.endpoint.claimed_id)
-class TestAuthRequestOpenID2(TestAuthRequestMixin, unittest.TestCase):
+class TestAuthRequestOpenID2(AuthRequestTestMixin, unittest.TestCase):
preferred_namespace = message.OPENID2_NS
def failUnlessHasRealm(self, msg):
@@ -151,7 +151,7 @@ def test_opIdentifierSendsIdentifierSelect(self):
self.failUnlessHasIdentifiers(
msg, message.IDENTIFIER_SELECT, message.IDENTIFIER_SELECT)
-class TestAuthRequestOpenID1(TestAuthRequestMixin, unittest.TestCase):
+class TestAuthRequestOpenID1(AuthRequestTestMixin, unittest.TestCase):
preferred_namespace = message.OPENID1_NS
def setUpEndpoint(self):

0 comments on commit b1d3769

Please sign in to comment.