~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_crash.py

  • Committer: Andrew Bennetts
  • Date: 2011-02-07 04:14:29 UTC
  • mfrom: (5535.4.26 fetch-all-tags-309682)
  • mto: This revision was merged to the branch mainline in revision 5648.
  • Revision ID: andrew.bennetts@canonical.com-20110207041429-3kc1blj34rvvxod9
Merge fetch-all-tags-309682.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2009, 2010, 2011 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
26
26
    config,
27
27
    crash,
28
28
    osutils,
29
 
    symbol_versioning,
 
29
    plugin,
30
30
    tests,
31
31
    )
32
32
 
40
40
    def test_apport_report(self):
41
41
        crash_dir = osutils.joinpath((self.test_base_dir, 'crash'))
42
42
        os.mkdir(crash_dir)
43
 
        os.environ['APPORT_CRASH_DIR'] = crash_dir
 
43
        self.overrideEnv('APPORT_CRASH_DIR', crash_dir)
44
44
        self.assertEquals(crash_dir, config.crash_dir())
45
45
 
 
46
        self.overrideAttr(
 
47
            plugin,
 
48
            'plugin_warnings',
 
49
            {'example': ['Failed to load plugin foo']})
 
50
 
46
51
        stderr = StringIO()
47
52
 
48
53
        try:
72
77
        self.assertContainsRe(report, 'test_apport_report')
73
78
        # should also be in there
74
79
        self.assertContainsRe(report, '(?m)^CommandLine:')
 
80
        self.assertContainsRe(
 
81
            report,
 
82
            'Failed to load plugin foo')