~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(vila) Migrate more branch config options to config stacks. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
        self.run_send([])
201
201
        self.run_bzr_error(('Unknown mail client: bogus',),
202
202
                           'send -f branch --mail-to jrandom@example.org')
203
 
        b.get_config().set_user_option('submit_to', 'jrandom@example.org')
 
203
        b.get_config_stack().set('submit_to', 'jrandom@example.org')
204
204
        self.run_bzr_error(('Unknown mail client: bogus',),
205
205
                           'send -f branch')
206
206
 
209
209
        b = branch.Branch.open('branch')
210
210
        b.get_config().set_user_option('mail_client', 'bogus')
211
211
        parent = branch.Branch.open('parent')
212
 
        parent.get_config().set_user_option('child_submit_to',
213
 
                           'somebody@example.org')
214
 
        self.run_bzr_error(('Unknown mail client: bogus',),
215
 
                           'send -f branch')
 
212
        parent.get_config_stack().set('child_submit_to', 'somebody@example.org')
 
213
        self.run_bzr_error(('Unknown mail client: bogus',), 'send -f branch')
216
214
 
217
215
    def test_format(self):
218
216
        md = self.get_MD(['--format=4'])
230
228
                            'send -f branch -o- --format=0.999')[0]
231
229
 
232
230
    def test_format_child_option(self):
233
 
        parent_config = branch.Branch.open('parent').get_config()
234
 
        parent_config.set_user_option('child_submit_format', '4')
 
231
        parent_config = branch.Branch.open('parent').get_config_stack()
 
232
        parent_config.set('child_submit_format', '4')
235
233
        md = self.get_MD([])
236
234
        self.assertIs(merge_directive.MergeDirective2, md.__class__)
237
235
 
238
 
        parent_config.set_user_option('child_submit_format', '0.9')
 
236
        parent_config.set('child_submit_format', '0.9')
239
237
        md = self.get_MD([])
240
238
        self.assertFormatIs('# Bazaar revision bundle v0.9', md)
241
239
 
243
241
        self.assertFormatIs('# Bazaar revision bundle v0.9', md)
244
242
        self.assertIs(merge_directive.MergeDirective, md.__class__)
245
243
 
246
 
        parent_config.set_user_option('child_submit_format', '0.999')
 
244
        parent_config.set('child_submit_format', '0.999')
247
245
        self.run_bzr_error(["No such send format '0.999'"],
248
246
                            'send -f branch -o-')[0]
249
247