/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_mail_client.py

  • Committer: John Arbash Meinel
  • Date: 2008-03-14 16:32:01 UTC
  • mfrom: (3277 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3280.
  • Revision ID: john@arbash-meinel.com-20080314163201-33r5errgr41hzaci
[merge] bzr.dev 3277, cleanup NEWS indentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        self.assertEqual(['-s', 'Hi there!', 'jrandom@example.org'],
33
33
                         commandline)
34
34
 
 
35
    def test_commandline_is_8bit(self):
 
36
        mutt = mail_client.Mutt(None)
 
37
        cmdline = mutt._get_compose_commandline(u'jrandom@example.org',
 
38
            u'Hi there!', u'file%')
 
39
        self.assertEqual(
 
40
            ['-s', 'Hi there!', '-a', 'file%', 'jrandom@example.org'],
 
41
            cmdline)
 
42
        for item in cmdline:
 
43
            self.assertFalse(isinstance(item, unicode),
 
44
                'Command-line item %r is unicode!' % item)
 
45
 
35
46
 
36
47
class TestThunderbird(tests.TestCase):
37
48
 
46
57
        self.assertEqual(['-compose', "subject='Hi there!',"
47
58
                                      "to='jrandom@example.org'"], commandline)
48
59
 
 
60
    def test_commandline_is_8bit(self):
 
61
        # test for bug #139318
 
62
        tbird = mail_client.Thunderbird(None)
 
63
        cmdline = tbird._get_compose_commandline(u'jrandom@example.org',
 
64
            u'Hi there!', u'file%')
 
65
        self.assertEqual(['-compose',
 
66
            ("attachment='%s'," % urlutils.local_path_to_url('file%')) +
 
67
            "subject='Hi there!',to='jrandom@example.org'",
 
68
            ], cmdline)
 
69
        for item in cmdline:
 
70
            self.assertFalse(isinstance(item, unicode),
 
71
                'Command-line item %r is unicode!' % item)
 
72
 
49
73
 
50
74
class TestXDGEmail(tests.TestCase):
51
75
 
63
87
        self.assertEqual(['jrandom@example.org', '--subject', 'Hi there!'],
64
88
                         commandline)
65
89
 
 
90
    def test_commandline_is_8bit(self):
 
91
        xdg_email = mail_client.XDGEmail(None)
 
92
        cmdline = xdg_email._get_compose_commandline(u'jrandom@example.org',
 
93
            u'Hi there!', u'file%')
 
94
        self.assertEqual(
 
95
            ['jrandom@example.org', '--subject', 'Hi there!',
 
96
             '--attach', 'file%'],
 
97
            cmdline)
 
98
        for item in cmdline:
 
99
            self.assertFalse(isinstance(item, unicode),
 
100
                'Command-line item %r is unicode!' % item)
 
101
 
66
102
 
67
103
class TestEvolution(tests.TestCase):
68
104
 
75
111
        self.assertEqual(['mailto:jrandom@example.org?subject=Hi%20there%21'],
76
112
                         commandline)
77
113
 
 
114
    def test_commandline_is_8bit(self):
 
115
        evo = mail_client.Evolution(None)
 
116
        cmdline = evo._get_compose_commandline(u'jrandom@example.org',
 
117
            u'Hi there!', u'file%')
 
118
        self.assertEqual(
 
119
            ['mailto:jrandom@example.org?attach=file%25&subject=Hi%20there%21'
 
120
            ],
 
121
            cmdline)
 
122
        for item in cmdline:
 
123
            self.assertFalse(isinstance(item, unicode),
 
124
                'Command-line item %r is unicode!' % item)
 
125
 
78
126
 
79
127
class TestKMail(tests.TestCase):
80
128
 
87
135
        self.assertEqual(['-s', 'Hi there!', 'jrandom@example.org'],
88
136
                         commandline)
89
137
 
 
138
    def test_commandline_is_8bit(self):
 
139
        kmail = mail_client.KMail(None)
 
140
        cmdline = kmail._get_compose_commandline(u'jrandom@example.org',
 
141
            u'Hi there!', u'file%')
 
142
        self.assertEqual(
 
143
            ['-s', 'Hi there!', '--attach', 'file%', 'jrandom@example.org'],
 
144
            cmdline)
 
145
        for item in cmdline:
 
146
            self.assertFalse(isinstance(item, unicode),
 
147
                'Command-line item %r is unicode!' % item)
 
148
 
90
149
 
91
150
class TestEditor(tests.TestCase):
92
151