~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_conflicts.py

[merge] land Robert's branch-formats branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
import os
19
19
 
20
 
from bzrlib.tests import TestCaseInTempDir
 
20
from bzrlib.tests import TestCaseWithTransport
21
21
from bzrlib.branch import Branch
22
 
from bzrlib.commit import Commit
23
22
from bzrlib.conflicts import restore
24
23
from bzrlib.errors import NotConflicted
25
24
 
26
25
# TODO: Test commit with some added, and added-but-missing files
 
26
# RBC 20060124 is that not tested in test_commit.py ?
27
27
 
28
 
class TestConflicts(TestCaseInTempDir):
 
28
class TestConflicts(TestCaseWithTransport):
29
29
 
30
30
    def test_conflicts(self):
31
31
        """Conflicts are detected properly"""
32
 
        b = Branch.initialize(u'.')
 
32
        tree = self.make_branch_and_tree('.')
 
33
        b = tree.branch
33
34
        file('hello', 'w').write('hello world4')
34
35
        file('hello.THIS', 'w').write('hello world2')
35
36
        file('hello.BASE', 'w').write('hello world1')
36
37
        file('hello.OTHER', 'w').write('hello world3')
37
38
        file('hello.sploo.BASE', 'w').write('yellow world')
38
39
        file('hello.sploo.OTHER', 'w').write('yellow world2')
39
 
        tree = b.working_tree()
40
40
        self.assertEqual(len(list(tree.list_files())), 6)
41
41
        conflicts = list(tree.iter_conflicts())
42
42
        self.assertEqual(len(conflicts), 2)