180
183
'Command-line item %r is unicode!' % item)
186
class TestClaws(tests.TestCase):
188
def test_commandline(self):
189
claws = mail_client.Claws(None)
190
commandline = claws._get_compose_commandline(None, None, 'file%')
191
self.assertEqual(['--compose', '?attach=file%25'], commandline)
192
commandline = claws._get_compose_commandline(
193
'jrandom@example.org', 'Hi there!', None)
195
['--compose', 'jrandom@example.org?subject=Hi%20there%21'],
198
def test_commandline_with_config(self):
199
claws = mail_client.Claws(InstrumentedConfig())
200
commandline = claws._get_compose_commandline(None, None, 'file%')
202
['--compose', ('?attach=file%25&from=Robert%20Collins%20'
203
'%3Crobert.collins%40example.org%3E')],
205
commandline = claws._get_compose_commandline(
206
'jrandom@example.org', 'Hi there!', None)
208
['--compose', ('jrandom@example.org?subject=Hi%20there%21'
209
'&from=Robert%20Collins%20'
210
'%3Crobert.collins%40example.org%3E')],
213
def test_commandline_is_8bit(self):
214
claws = mail_client.Claws(None)
215
cmdline = claws._get_compose_commandline(
216
u'jrandom@example.org', u'Hi there!', u'file%')
219
'jrandom@example.org?subject=Hi%20there%21&attach=file%25'],
222
self.assertFalse(isinstance(item, unicode),
223
'Command-line item %r is unicode!' % item)
183
226
class TestEditor(tests.TestCase):
185
228
def test_get_merge_prompt_unicode(self):