~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_send.py

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    merge_directive,
25
25
    tests,
26
26
    )
 
27
from bzrlib.controldir import ControlDir
27
28
from bzrlib.bundle import serializer
28
29
from bzrlib.transport import memory
29
30
from bzrlib.tests import (
192
193
 
193
194
    def test_mailto_option(self):
194
195
        b = branch.Branch.open('branch')
195
 
        b.get_config().set_user_option('mail_client', 'editor')
 
196
        b.get_config_stack().set('mail_client', 'editor')
196
197
        self.run_bzr_error(
197
198
            ('No mail-to address \\(--mail-to\\) or output \\(-o\\) specified',
198
199
            ), 'send -f branch')
199
 
        b.get_config().set_user_option('mail_client', 'bogus')
 
200
        b.get_config_stack().set('mail_client', 'bogus')
200
201
        self.run_send([])
201
 
        self.run_bzr_error(('Unknown mail client: bogus',),
 
202
        self.run_bzr_error(('Bad value "bogus" for option "mail_client"',),
202
203
                           'send -f branch --mail-to jrandom@example.org')
203
204
        b.get_config_stack().set('submit_to', 'jrandom@example.org')
204
 
        self.run_bzr_error(('Unknown mail client: bogus',),
 
205
        self.run_bzr_error(('Bad value "bogus" for option "mail_client"',),
205
206
                           'send -f branch')
206
207
 
207
208
    def test_mailto_child_option(self):
208
209
        """Make sure that child_submit_to is used."""
209
210
        b = branch.Branch.open('branch')
210
 
        b.get_config().set_user_option('mail_client', 'bogus')
 
211
        b.get_config_stack().set('mail_client', 'bogus')
211
212
        parent = branch.Branch.open('parent')
212
213
        parent.get_config_stack().set('child_submit_to', 'somebody@example.org')
213
 
        self.run_bzr_error(('Unknown mail client: bogus',), 'send -f branch')
 
214
        self.run_bzr_error(('Bad value "bogus" for option "mail_client"',),
 
215
                'send -f branch')
214
216
 
215
217
    def test_format(self):
216
218
        md = self.get_MD(['--format=4'])
329
331
        super(TestSendStrictWithoutChanges, self).setUp()
330
332
        self.make_parent_and_local_branches()
331
333
 
 
334
    def test_send_without_workingtree(self):
 
335
        ControlDir.open("local").destroy_workingtree()
 
336
        self.assertSendSucceeds([])
 
337
 
332
338
    def test_send_default(self):
333
339
        self.assertSendSucceeds([])
334
340