~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: 2010-04-28 10:33:44 UTC
  • mfrom: (5171.2.3 401599-strict-warnings)
  • mto: This revision was merged to the branch mainline in revision 5191.
  • Revision ID: v.ladeuil+lp@free.fr-20100428103344-e32qf3cn1avdd2cb
Don't mention --no-strict when we just issue the warning about unclean trees

Show diffs side-by-side

added added

removed removed

Lines of Context:
307
307
    _default_sent_revs = ['local']
308
308
    _default_errors = ['Working tree ".*/local/" has uncommitted '
309
309
                       'changes \(See bzr status\)\.',]
 
310
    _default_additional_error = 'Use --no-strict to force the send.\n'
 
311
    _default_additional_warning = 'Uncommitted changes will not be sent.'
310
312
 
311
313
    def set_config_send_strict(self, value):
312
314
        # set config var (any of bazaar.conf, locations.conf, branch.conf
315
317
        conf.set_user_option('send_strict', value)
316
318
 
317
319
    def assertSendFails(self, args):
318
 
        self.run_send(args, rc=3, err_re=self._default_errors)
 
320
        out, err = self.run_send(args, rc=3, err_re=self._default_errors)
 
321
        self.assertContainsRe(err, self._default_additional_error)
319
322
 
320
323
    def assertSendSucceeds(self, args, revs=None, with_warning=False):
321
324
        if with_warning:
327
330
        out, err = self.run_send(args, err_re=err_re)
328
331
        bundling_revs = 'Bundling %d revision(s).\n' % len(revs)
329
332
        if with_warning:
 
333
            self.assertContainsRe(err, self._default_additional_warning)
330
334
            self.assertEndsWith(err, bundling_revs)
331
335
        else:
332
336
            self.assertEquals(bundling_revs, err)