~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-06 20:45:48 UTC
  • mfrom: (4728.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20091006204548-bjnc3z4k256ppimz
MutableTree.has_changes() does not require a tree parameter anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
class TestExceptionReporting(TestCase):
35
35
 
36
 
    def test_report_exception(self):
37
 
        """When an error occurs, display bug report details to stderr"""
38
 
        try:
39
 
            raise AssertionError("failed")
40
 
        except AssertionError, e:
41
 
            erf = StringIO()
42
 
            trace.report_exception(sys.exc_info(), erf)
43
 
        err = erf.getvalue()
44
 
        self.assertContainsRe(err,
45
 
            r'bzr: ERROR: exceptions\.AssertionError: failed\n')
46
 
        self.assertContainsRe(err,
47
 
            r'Please report a bug at https://bugs\.launchpad\.net/bzr/\+filebug')
48
 
        self.assertContainsRe(err,
49
 
            '(?m)^encoding: .*, fsenc: .*, lang: .*')
50
 
        self.assertContainsRe(err,
51
 
            '(?m)^plugins:$')
52
 
 
53
36
    def test_exception_exitcode(self):
54
37
        # we must use a subprocess, because the normal in-memory mechanism
55
38
        # allows errors to propagate up through the test suite
58
41
            retcode=errors.EXIT_INTERNAL_ERROR)
59
42
        self.assertEqual(4, errors.EXIT_INTERNAL_ERROR)
60
43
        self.assertContainsRe(err,
61
 
                r'bzr: ERROR: exceptions\.AssertionError: always fails\n')
62
 
        self.assertContainsRe(err, r'Please report a bug at')
 
44
                r'exceptions\.AssertionError: always fails\n')
 
45
        self.assertContainsRe(err, r'Bazaar has encountered an internal error')
63
46
 
64
47
 
65
48
class TestDeprecationWarning(TestCaseInTempDir):