~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/mail/tests/test_dkim.py

  • Committer: Martin Pool
  • Date: 2011-10-26 02:30:11 UTC
  • mto: This revision was merged to the branch mainline in revision 14199.
  • Revision ID: mbp@canonical.com-20111026023011-qd3cpyxy5xt115c5
Unexpected errors in pydkim are not fatal to incoming.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
            self.fail("didn't find %r in log: %s" % (substring, l))
121
121
 
122
122
    def test_dkim_broken_pubkey(self):
123
 
        """Handle a subtly-broken pubkey like qq.com, see bug 881237."""
 
123
        """Handle a subtly-broken pubkey like qq.com, see bug 881237.
 
124
 
 
125
        The message is not trusted but inbound message processing does not
 
126
        abort either.
 
127
        """
124
128
        signed_message = self.fake_signing(plain_content)
125
129
        self._dns_responses['example._domainkey.canonical.com.'] = \
126
130
            sample_dns.replace(';', '')
129
133
        self.assertWeaklyAuthenticated(principal, signed_message)
130
134
        self.assertEqual(principal.person.preferredemail.email,
131
135
            'foo.bar@canonical.com')
132
 
        self.assertDkimLogContains('invalid format in _domainkey txt record')
 
136
        self.assertDkimLogContains('unexpected error in DKIM verification')
133
137
 
134
138
    def test_dkim_garbage_pubkey(self):
135
139
        signed_message = self.fake_signing(plain_content)