~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: Robert Collins
  • Date: 2010-02-27 12:27:33 UTC
  • mto: This revision was merged to the branch mainline in revision 5061.
  • Revision ID: robertc@robertcollins.net-20100227122733-2o3me3fkk3pk36ns
``bzrlib.branchbuilder.BranchBuilder.build_snapshot`` now accepts a
``message_callback`` in the same way that commit does. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    pop_log_file,
37
37
    push_log_file,
38
38
    _rollover_trace_maybe,
39
 
    show_error,
40
39
    )
41
40
 
42
41
 
216
215
        # have to do a replaceent here as well.
217
216
        self.assertContainsRe(log, "ascii argument: \xb5".decode('utf8',
218
217
            'replace'))
219
 
        
220
 
    def test_show_error(self):
221
 
        show_error('error1')
222
 
        show_error(u'error2 \xb5 blah')
223
 
        show_error('arg: %s', 'blah')
224
 
        show_error('arg2: %(key)s', {'key':'stuff'})
225
 
        try:
226
 
            raise Exception("oops")
227
 
        except:
228
 
            show_error('kwarg', exc_info=True)
229
 
        log = self.get_log()
230
 
        self.assertContainsRe(log, 'error1')
231
 
        self.assertContainsRe(log, u'error2 \xb5 blah')
232
 
        self.assertContainsRe(log, 'arg: blah')
233
 
        self.assertContainsRe(log, 'arg2: stuff')
234
 
        self.assertContainsRe(log, 'kwarg')
235
 
        self.assertContainsRe(log, 'Traceback \\(most recent call last\\):')
236
 
        self.assertContainsRe(log, 'File ".*test_trace.py", line .*, in test_show_error')
237
 
        self.assertContainsRe(log, 'raise Exception\\("oops"\\)')
238
 
        self.assertContainsRe(log, 'Exception: oops')
239
218
 
240
219
    def test_push_log_file(self):
241
220
        """Can push and pop log file, and this catches mutter messages.