/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/blackbox/test_send.py

merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import os
20
20
from StringIO import StringIO
21
21
 
22
 
from bzrlib import merge_directive
 
22
from bzrlib import (
 
23
    branch as _mod_branch,
 
24
    merge_directive,
 
25
    )
23
26
from bzrlib.bundle import serializer
24
27
from bzrlib.bzrdir import BzrDir
25
28
from bzrlib import tests
186
189
        stdout = self.run_bzr('send -f branch --output -')[0]
187
190
        self.assertContainsRe(stdout, 'revision3')
188
191
 
189
 
    def test_output_option_required(self):
 
192
    def test_mailto_option(self):
190
193
        self.make_trees()
191
 
        self.run_bzr_error(('File must be specified with --output',),
 
194
        branch = _mod_branch.Branch.open('branch')
 
195
        branch.get_config().set_user_option('mail_client', 'bogus')
 
196
        self.run_bzr_error(('No mail-to address specified',), 'send -f branch')
 
197
        self.run_bzr('send -f branch -o-')
 
198
        self.run_bzr_error(('Unknown mail client: bogus',),
 
199
                           'send -f branch --mail-to jrandom@example.org')
 
200
        branch.get_config().set_user_option('submit_to', 'jrandom@example.org')
 
201
        self.run_bzr_error(('Unknown mail client: bogus',),
192
202
                           'send -f branch')
193
203
 
194
204
    def test_format(self):
207
217
        self.assertIs(merge_directive.MergeDirective, md.__class__)
208
218
        self.run_bzr_error(['Bad value .* for option .format.'],
209
219
                            'send -f branch -o- --format=0.999')[0]
 
220
 
 
221
    def test_message_option(self):
 
222
        self.make_trees()
 
223
        self.run_bzr('send', retcode=3)
 
224
        md = self.send_directive(['--from', 'branch'])
 
225
        self.assertIs(None, md.message)
 
226
        md = self.send_directive(['--from', 'branch', '-m', 'my message'])
 
227
        self.assertEqual('my message', md.message)