~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_mail_client.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-06 06:48:25 UTC
  • mfrom: (4070.8.6 debug-config)
  • Revision ID: pqm@pqm.ubuntu.com-20090306064825-kbpwggw21dygeix6
(mbp) debug_flags configuration option

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import urllib
18
18
 
56
56
        self.assertEqual(['-compose', "attachment='%s'" %
57
57
                          urlutils.local_path_to_url('file%')], commandline)
58
58
        commandline = tbird._get_compose_commandline('jrandom@example.org',
59
 
                                                     'Hi there!', None,
60
 
                                                     "bo'dy")
61
 
        self.assertEqual(['-compose', "body=bo%27dy,"
62
 
                                      "subject='Hi there!',"
63
 
                                      "to='jrandom@example.org'"],
64
 
                                      commandline)
 
59
                                                     'Hi there!', None)
 
60
        self.assertEqual(['-compose', "subject='Hi there!',"
 
61
                                      "to='jrandom@example.org'"], commandline)
65
62
 
66
63
    def test_commandline_is_8bit(self):
67
64
        # test for bug #139318
122
119
        self.assertEqual(['jrandom@example.org', '--attach', 'file%'],
123
120
                         commandline)
124
121
        commandline = xdg_email._get_compose_commandline(
125
 
            'jrandom@example.org', 'Hi there!', None, "bo'dy")
126
 
        self.assertEqual(['jrandom@example.org', '--subject', 'Hi there!',
127
 
                          '--body', "bo'dy"], commandline)
 
122
            'jrandom@example.org', 'Hi there!', None)
 
123
        self.assertEqual(['jrandom@example.org', '--subject', 'Hi there!'],
 
124
                         commandline)
128
125
 
129
126
    def test_commandline_is_8bit(self):
130
127
        xdg_email = mail_client.XDGEmail(None)
146
143
        commandline = evo._get_compose_commandline(None, None, 'file%')
147
144
        self.assertEqual(['mailto:?attach=file%25'], commandline)
148
145
        commandline = evo._get_compose_commandline('jrandom@example.org',
149
 
                                                   'Hi there!', None, 'bo&dy')
150
 
        self.assertEqual(['mailto:jrandom@example.org?body=bo%26dy&'
151
 
                          'subject=Hi%20there%21'], commandline)
 
146
                                                   'Hi there!', None)
 
147
        self.assertEqual(['mailto:jrandom@example.org?subject=Hi%20there%21'],
 
148
                         commandline)
152
149
 
153
150
    def test_commandline_is_8bit(self):
154
151
        evo = mail_client.Evolution(None)
260
257
                                     basename=basename)
261
258
        dummy_client = client.client
262
259
        self.assertEqual(dummy_client.args, (to, subject, directive))
263
 
        self.assertEqual(dummy_client.kwargs,
264
 
                         {"basename": basename, 'body': None})
 
260
        self.assertEqual(dummy_client.kwargs, {"basename":basename})