15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
20
from StringIO import StringIO
25
24
from bzrlib import (
71
71
self.assertContainsRe(report, 'test_apport_report')
72
72
# should also be in there
73
73
self.assertContainsRe(report, '(?m)^CommandLine:')
76
class TestNonApportReporting(tests.TestCase):
77
"""Reporting of crash-type bugs without apport.
79
This should work in all environments.
82
def setup_fake_plugins(self):
84
fake = plugin.PlugIn('fake_plugin', plugin)
85
fake.version_info = lambda: (1, 2, 3)
86
return {"fake_plugin": fake}
87
self.overrideAttr(plugin, 'plugins', fake_plugins)
89
def test_report_bug_legacy(self):
90
self.setup_fake_plugins()
93
raise AssertionError("my error")
94
except AssertionError, e:
96
crash.report_bug_legacy(sys.exc_info(), err_file)
97
self.assertDoctestExampleMatches("""\
98
bzr: ERROR: exceptions.AssertionError: my error
100
Traceback (most recent call last):
102
AssertionError: my error
104
bzr ... on python ...
106
plugins: fake_plugin[1.2.3]
109
*** Bazaar has encountered an internal error. This probably indicates a
110
bug in Bazaar. You can help us fix it by filing a bug report at
111
https://bugs.launchpad.net/bzr/+filebug
112
including this traceback and a description of the problem.