/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:10:44 UTC
  • mto: This revision was merged to the branch mainline in revision 772.
  • Revision ID: sinzui.is@verizon.net-20120123181044-iflf8h79dg6y8fit
Update test to verify that the correct text is shown.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
    def test_treeview_cursor_cb(self):
117
117
        widget = FakeDiffWidget()
118
118
        widget.set_diff_text_sections(
119
 
            [('', None, 'patch'), ('a', 'a', 'patch')])
120
 
        MockMethod.bind(self, widget.diff_view, 'show_diff')
 
119
            [('', None, 'patch1'), ('a', 'a', 'patch2')])
121
120
        widget.treeview.set_cursor(Gtk.TreePath(path=1), None, False)
122
121
        widget._treeview_cursor_cb(None)
123
 
        self.assertTrue(widget.diff_view.show_diff.called)
124
 
        self.assertEqual((['a'],), widget.diff_view.show_diff.args)
 
122
        self.assertTrue('patch2', widget.diff_view.buffer.props.text)
125
123
 
126
124
    def test_treeview_cursor_cb_with_destroyed_treeview(self):
127
125
        widget = FakeDiffWidget()
128
126
        widget.set_diff_text_sections(
129
 
            [('', None, 'patch'), ('a', 'a', 'patch')])
 
127
            [('', None, 'patch1'), ('a', 'a', 'patch2')])
130
128
        MockMethod.bind(self, widget.diff_view, 'show_diff')
131
129
        widget.treeview.destroy()
132
130
        widget._treeview_cursor_cb(None)