/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 18:03:33 UTC
  • mto: This revision was merged to the branch mainline in revision 772.
  • Revision ID: sinzui.is@verizon.net-20120123180333-b4gfaywl1280i3mg
Added test for success.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from cStringIO import StringIO
19
19
import os
20
20
 
 
21
from gi.repository import Gtk
 
22
 
21
23
from bzrlib import (
22
24
    conflicts,
23
25
    errors,
111
113
 
112
114
class TestDiffWidget(tests.TestCaseWithTransport):
113
115
 
114
 
    def test_treeview_cursor_cbd_with_destroyed_treeview(self):
115
 
        widget = FakeDiffWidget()
116
 
        widget.set_diff_text_sections([('a', None, 'patch')])
 
116
    def test_treeview_cursor_cb(self):
 
117
        widget = FakeDiffWidget()
 
118
        widget.set_diff_text_sections(
 
119
            [('', None, 'patch'), ('a', 'a', 'patch')])
 
120
        MockMethod.bind(self, widget.diff_view, 'show_diff')
 
121
        widget.treeview.set_cursor(Gtk.TreePath(path=1), None, False)
 
122
        widget._treeview_cursor_cb(None)
 
123
        self.assertTrue(widget.diff_view.show_diff.called)
 
124
        self.assertEqual((['a'],), widget.diff_view.show_diff.args)
 
125
 
 
126
    def test_treeview_cursor_cb_with_destroyed_treeview(self):
 
127
        widget = FakeDiffWidget()
 
128
        widget.set_diff_text_sections(
 
129
            [('', None, 'patch'), ('a', 'a', 'patch')])
117
130
        MockMethod.bind(self, widget.diff_view, 'show_diff')
118
131
        widget.treeview.destroy()
119
132
        widget._treeview_cursor_cb(None)