~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_mail_client.py

  • Committer: Andrew Bennetts
  • Date: 2009-06-09 03:14:05 UTC
  • mfrom: (4416 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4420.
  • Revision ID: andrew.bennetts@canonical.com-20090609031405-wak9yogzzpx9o172
Merge bzr.dev, resolving NEWS conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
    def test_commandline(self):
192
192
        claws = mail_client.Claws(None)
193
193
        commandline = claws._get_compose_commandline(
194
 
            None, None, 'file%')
 
194
            'jrandom@example.org', None, 'file%')
195
195
        self.assertEqual(
196
 
            ['--compose', 'mailto:?', '--attach', 'file%'], commandline)
 
196
            ['--compose', 'mailto:jrandom@example.org?', '--attach', 'file%'],
 
197
            commandline)
197
198
        commandline = claws._get_compose_commandline(
198
199
            'jrandom@example.org', 'Hi there!', None)
199
200
        self.assertEqual(
217
218
            self.assertFalse(isinstance(item, unicode),
218
219
                'Command-line item %r is unicode!' % item)
219
220
 
 
221
    def test_with_from(self):
 
222
        claws = mail_client.Claws(None)
 
223
        cmdline = claws._get_compose_commandline(
 
224
            u'jrandom@example.org', None, None, None, u'qrandom@example.com')
 
225
        self.assertEqual(
 
226
            ['--compose',
 
227
             'mailto:jrandom@example.org?from=qrandom%40example.com'],
 
228
            cmdline)
 
229
 
 
230
    def test_to_required(self):
 
231
        claws = mail_client.Claws(None)
 
232
        self.assertRaises(errors.NoMailAddressSpecified,
 
233
                          claws._get_compose_commandline,
 
234
                          None, None, 'file%')
 
235
 
 
236
    def test_with_body(self):
 
237
        claws = mail_client.Claws(None)
 
238
        cmdline = claws._get_compose_commandline(
 
239
            u'jrandom@example.org', None, None, 'This is some body text')
 
240
        self.assertEqual(
 
241
            ['--compose',
 
242
             'mailto:jrandom@example.org?body=This%20is%20some%20body%20text'],
 
243
            cmdline)
 
244
 
220
245
 
221
246
class TestEditor(tests.TestCase):
222
247