~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: Robert Collins
  • Date: 2009-05-11 01:59:06 UTC
  • mto: This revision was merged to the branch mainline in revision 4593.
  • Revision ID: robertc@robertcollins.net-20090511015906-6zi6a9b8tuuhipc8
Less lock thrashing in check.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
48
48
class TestTrace(TestCase):
49
49
 
50
50
    def test_format_sys_exception(self):
51
 
        # Test handling of an internal/unexpected error that probably
52
 
        # indicates a bug in bzr.  The details of the message may vary
53
 
        # depending on whether apport is available or not.  See test_crash for
54
 
        # more.
55
51
        try:
56
52
            raise NotImplementedError, "time travel"
57
53
        except NotImplementedError:
60
56
        self.assertEqualDiff(err.splitlines()[0],
61
57
                'bzr: ERROR: exceptions.NotImplementedError: time travel')
62
58
        self.assertContainsRe(err,
63
 
            'Bazaar has encountered an internal error.')
 
59
                r'File.*test_trace.py')
64
60
 
65
61
    def test_format_interrupt_exception(self):
66
62
        try:
126
122
            pass
127
123
        msg = _format_exception()
128
124
        self.assertContainsRe(msg,
129
 
            r'Bazaar has encountered an internal error')
 
125
            r"Traceback \(most recent call last\)")
130
126
 
131
127
    def test_trace_unicode(self):
132
128
        """Write Unicode to trace log"""