~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_mail_client.py

  • Committer: Jelmer Vernooij
  • Date: 2009-06-09 00:59:51 UTC
  • mto: (4443.1.1 bzr.dev)
  • mto: This revision was merged to the branch mainline in revision 4444.
  • Revision ID: jelmer@samba.org-20090609005951-apv900cdk35o2ygh
Move squashing of XML-invalid characters to XMLSerializer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
    def test_commandline(self):
30
30
        mutt = mail_client.Mutt(None)
31
 
        commandline = mutt._get_compose_commandline(
32
 
            None, None, 'file%', body="hello")
33
 
        # The temporary filename is randomly generated, so it is not matched.
34
 
        self.assertEqual(['-a', 'file%', '-i'], commandline[:-1])
 
31
        commandline = mutt._get_compose_commandline(None, None, 'file%')
 
32
        self.assertEqual(['-a', 'file%'], commandline)
35
33
        commandline = mutt._get_compose_commandline('jrandom@example.org',
36
34
                                                     'Hi there!', None)
37
35
        self.assertEqual(['-s', 'Hi there!', '--', 'jrandom@example.org'],
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%')
100
 
        if eclient.elisp_tmp_file is not None:
101
 
            self.addCleanup(osutils.delete_any, eclient.elisp_tmp_file)
102
98
        commandline = ' '.join(cmdline)
103
99
        self.assertContainsRe(commandline, '--eval')
104
100
        self.assertContainsRe(commandline, '(compose-mail nil nil)')
109
105
        eclient = mail_client.EmacsMail(None)
110
106
        commandline = eclient._get_compose_commandline(u'jrandom@example.org',
111
107
            u'Hi there!', u'file%')
112
 
        if eclient.elisp_tmp_file is not None:
113
 
            self.addCleanup(osutils.delete_any, eclient.elisp_tmp_file)
114
108
        for item in commandline:
115
109
            self.assertFalse(isinstance(item, unicode),
116
110
                'Command-line item %r is unicode!' % item)