/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_crash.py

  • Committer: John Arbash Meinel
  • Date: 2011-01-25 22:54:08 UTC
  • mto: This revision was merged to the branch mainline in revision 5636.
  • Revision ID: john@arbash-meinel.com-20110125225408-w5b5mmh117q4jjz1
Implement a reset-to-known-state ability for DirState.

Use this in reset_state(). Allow it to use header information if it can
be parsed, otherwise allow us to pass in the information.

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')