~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_mail_client.py

  • Committer: Vincent Ladeuil
  • Date: 2017-01-17 13:48:10 UTC
  • mfrom: (6615.3.6 merges)
  • mto: This revision was merged to the branch mainline in revision 6620.
  • Revision ID: v.ladeuil+lp@free.fr-20170117134810-j9p3lidfy6pfyfsc
Merge 2.7, resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
import urllib
18
 
 
19
17
from bzrlib import (
20
18
    errors,
21
19
    mail_client,
97
95
        # We won't be able to know the temporary file name at this stage
98
96
        # so we can't raise an assertion with assertEqual
99
97
        cmdline = eclient._get_compose_commandline(None, None, 'file%')
 
98
        if eclient.elisp_tmp_file is not None:
 
99
            self.addCleanup(osutils.delete_any, eclient.elisp_tmp_file)
100
100
        commandline = ' '.join(cmdline)
101
101
        self.assertContainsRe(commandline, '--eval')
102
102
        self.assertContainsRe(commandline, '(compose-mail nil nil)')
107
107
        eclient = mail_client.EmacsMail(None)
108
108
        commandline = eclient._get_compose_commandline(u'jrandom@example.org',
109
109
            u'Hi there!', u'file%')
 
110
        if eclient.elisp_tmp_file is not None:
 
111
            self.addCleanup(osutils.delete_any, eclient.elisp_tmp_file)
110
112
        for item in commandline:
111
113
            self.assertFalse(isinstance(item, unicode),
112
114
                'Command-line item %r is unicode!' % item)
208
210
        claws = mail_client.Claws(None)
209
211
        cmdline = claws._get_compose_commandline(
210
212
            u'jrandom@example.org', u'\xb5cosm of fun!', u'file%')
211
 
        subject_string = urllib.quote(
 
213
        subject_string = urlutils.quote(
212
214
            u'\xb5cosm of fun!'.encode(osutils.get_user_encoding(), 'replace'))
213
215
        self.assertEqual(
214
216
            ['--compose',