~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_conflicts.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-23 15:55:12 UTC
  • mfrom: (1551.15.59 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20070723155512-ckelzx8u6m5vxyja
Test that default behavior is as before

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
        l = ConflictList([TextConflict('hello')])
90
90
        l.remove_files(tree)
91
91
 
 
92
    def test_select_conflicts(self):
 
93
        tree = self.make_branch_and_tree('.')
 
94
        tree_conflicts = ConflictList([ContentsConflict('foo'),
 
95
                                       ContentsConflict('bar')])
 
96
        self.assertEqual((ConflictList([ContentsConflict('bar')]),
 
97
                          ConflictList([ContentsConflict('foo')])),
 
98
                         tree_conflicts.select_conflicts(tree, ['foo']))
 
99
        self.assertEqual((ConflictList(), tree_conflicts),
 
100
                         tree_conflicts.select_conflicts(tree, [''],
 
101
                         ignore_misses=True, recurse=True))
 
102
        tree_conflicts = ConflictList([ContentsConflict('foo/baz'),
 
103
                                       ContentsConflict('bar')])
 
104
        self.assertEqual((ConflictList([ContentsConflict('bar')]),
 
105
                          ConflictList([ContentsConflict('foo/baz')])),
 
106
                         tree_conflicts.select_conflicts(tree, ['foo'],
 
107
                                                         recurse=True,
 
108
                                                         ignore_misses=True))
 
109
        tree_conflicts = ConflictList([PathConflict('qux', 'foo/baz')])
 
110
        self.assertEqual((ConflictList(), tree_conflicts),
 
111
                         tree_conflicts.select_conflicts(tree, ['foo'],
 
112
                                                         recurse=True,
 
113
                                                         ignore_misses=True))
 
114
        self.assertEqual((tree_conflicts, ConflictList()),
 
115
                         tree_conflicts.select_conflicts(tree, ['foo'],
 
116
                                                         ignore_misses=True))
 
117
 
92
118
 
93
119
class TestConflictStanzas(TestCase):
94
120