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')
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
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()
334
def test_send_without_workingtree(self):
335
ControlDir.open("local").destroy_workingtree()
336
self.assertSendSucceeds([])
332
338
def test_send_default(self):
333
339
self.assertSendSucceeds([])