/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: Aaron Bentley
  • Date: 2008-05-10 03:23:00 UTC
  • mto: This revision was merged to the branch mainline in revision 492.
  • Revision ID: aaron@aaronbentley.com-20080510032300-v7mdhm2zae04o356
Add more merge tests

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 bzrlib import errors, tests
22
 
from bzrlib.merge_directive import MergeDirective2
 
21
from bzrlib import tests
 
22
from bzrlib.merge_directive import MergeDirective
23
23
 
24
24
from bzrlib.plugins.gtk.diff import (
25
25
    DiffController,
69
69
class TestDiffView(tests.TestCaseWithTransport):
70
70
 
71
71
    def test_unicode(self):
72
 
        self.requireFeature(tests.UnicodeFilenameFeature)
 
72
        from bzrlib.tests.test_diff import UnicodeFilename
 
73
        self.requireFeature(UnicodeFilename)
73
74
 
74
75
        tree = self.make_branch_and_tree('tree')
75
76
        self.build_tree([u'tree/\u03a9'])
120
121
    def _conflicts(self):
121
122
        self.conflicts = True
122
123
 
123
 
    def _handle_error(self, e):
124
 
        self.handled_error = e
125
 
 
126
124
 
127
125
class TestDiffController(tests.TestCaseWithTransport):
128
126
 
168
166
        other.commit('second commit')
169
167
        other.lock_write()
170
168
        try:
171
 
            directive = MergeDirective2.from_objects(other.branch.repository,
172
 
                                                     other.last_revision(), 0,
173
 
                                                     0, 'this')
 
169
            directive = MergeDirective.from_objects(other.branch.repository,
 
170
                                                    other.last_revision(), 0,
 
171
                                                    0, 'this')
174
172
        finally:
175
173
            other.unlock()
176
174
        return this, other, directive
199
197
        self.assertEqual(other.last_revision(), this.get_parent_ids()[1])
200
198
        self.assertFileEqual('bar', 'this/foo')
201
199
 
202
 
    def test_perform_merge_uncommitted_changes(self):
203
 
        this, other, directive = self.make_this_other_directive()
204
 
        self.build_tree_contents([('this/foo', 'bar')])
205
 
        this.add('foo')
206
 
        window = self.make_merged_window(directive)
207
 
        self.assertIsInstance(window.handled_error, errors.UncommittedChanges)
208
 
 
209
200
 
210
201
class Test_IterChangesToStatus(tests.TestCaseWithTransport):
211
202