~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-13 01:11:42 UTC
  • mfrom: (13668.1.31 private-bug-0)
  • Revision ID: launchpad@pqm.canonical.com-20110813011142-b8xvpxhdja422ln2
[rs=sinzui][no-qa] Moved canonical.launchpad.mail to lp.services.mail,
 bugs.mail, code.mail.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Test the SignedMessage class."""
23
23
    import_secret_test_key,
24
24
    )
25
25
from canonical.launchpad.interfaces.gpghandler import IGPGHandler
26
 
from canonical.launchpad.interfaces.mail import IWeaklyAuthenticatedPrincipal
27
 
from canonical.launchpad.mail import signed_message_from_string
28
26
from canonical.testing.layers import DatabaseFunctionalLayer
29
27
from lp.registry.interfaces.person import IPersonSet
30
28
from lp.services.mail.incoming import (
31
29
    authenticateEmail,
32
30
    canonicalise_line_endings,
33
31
    )
 
32
from lp.services.mail.interfaces import IWeaklyAuthenticatedPrincipal
 
33
from lp.services.mail.signedmessage import signed_message_from_string
34
34
from lp.testing import TestCaseWithFactory
35
35
from lp.testing.factory import GPGSigningContext
36
36
 
103
103
        # signature.
104
104
        sender = getUtility(IPersonSet).getByEmail('test@canonical.com')
105
105
        body = (
106
 
            'A message with trailing spaces.   \n'+
107
 
            'And tabs\t\t\n'+
 
106
            'A message with trailing spaces.   \n'
 
107
            'And tabs\t\t\n'
108
108
            'Also mixed. \t ')
109
109
        msg = self._get_clearsigned_for_person(sender, body)
110
110
        principle = authenticateEmail(msg)