/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/test_diff.py

  • Committer: Curtis Hovey
  • Date: 2012-01-23 17:04:56 UTC
  • mto: This revision was merged to the branch mainline in revision 772.
  • Revision ID: sinzui.is@verizon.net-20120123170456-09ci0chsm91yjfea
Do not update diff_view when the treeview is being destroyed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from bzrlib.plugins.gtk.diff import (
33
33
    DiffController,
34
34
    DiffView,
 
35
    DiffWidget,
35
36
    iter_changes_to_status,
36
37
    MergeDirectiveController,
37
38
    )
 
39
from bzrlib.plugins.gtk.tests import MockMethod
 
40
 
 
41
 
38
42
eg_diff = """\
39
43
=== modified file 'tests/test_diff.py'
40
44
--- tests/test_diff.py  2008-03-11 13:18:28 +0000
99
103
            )
100
104
 
101
105
 
 
106
 
 
107
class FakeDiffWidget(DiffWidget):
 
108
 
 
109
    SHOW_WIDGETS = False
 
110
 
 
111
 
 
112
class TestDiffWidget(tests.TestCaseWithTransport):
 
113
 
 
114
    def test_treeview_cursor_cbd_with_destroyed_treeview(self):
 
115
        widget = FakeDiffWidget()
 
116
        widget.set_diff_text_sections([('a', None, 'patch')])
 
117
        MockMethod.bind(self, widget.diff_view, 'show_diff')
 
118
        widget.treeview.destroy()
 
119
        widget._treeview_cursor_cb(None)
 
120
        self.assertFalse(widget.diff_view.show_diff.called)
 
121
 
 
122
 
102
123
class MockDiffWidget(object):
103
124
 
104
125
    def set_diff_text_sections(self, sections):