71
71
'Command-line item %r is unicode!' % item)
74
class TestEmacsMail(tests.TestCase):
76
def test_commandline(self):
77
eclient = mail_client.EmacsMail(None)
79
commandline = eclient._get_compose_commandline(None, 'Hi there!', None)
80
self.assertEqual(['--eval', '(compose-mail nil "Hi there!")'],
83
commandline = eclient._get_compose_commandline('jrandom@example.org',
85
self.assertEqual(['--eval',
86
'(compose-mail "jrandom@example.org" "Hi there!")'],
89
# We won't be able to know the temporary file name at this stage
90
# so we can't raise an assertion with assertEqual
91
cmdline = eclient._get_compose_commandline(None, None, 'file%')
92
commandline = ' '.join(cmdline)
93
self.assertContainsRe(commandline, '--eval')
94
self.assertContainsRe(commandline, '(compose-mail nil nil)')
95
self.assertContainsRe(commandline, '(load .*)')
96
self.assertContainsRe(commandline, '(bzr-add-mime-att \"file%\")')
98
def test_commandline_is_8bit(self):
99
eclient = mail_client.EmacsMail(None)
100
commandline = eclient._get_compose_commandline(u'jrandom@example.org',
101
u'Hi there!', u'file%')
102
for item in commandline:
103
self.assertFalse(isinstance(item, unicode),
104
'Command-line item %r is unicode!' % item)
74
107
class TestXDGEmail(tests.TestCase):
76
109
def test_commandline(self):