~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/intertree_implementations/test_compare.py

Add tests for require_versioned to the InterTree.compare() test suite.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for the InterTree.compare() function."""
18
18
 
19
 
from bzrlib import inventory 
 
19
from bzrlib import errors
20
20
from bzrlib.tests.intertree_implementations import TestCaseWithTwoTrees
21
21
 
22
22
 
206
206
        self.assertEqual([], d.removed)
207
207
        self.assertEqual([], d.renamed)
208
208
        self.assertEqual([], d.unchanged)
 
209
 
 
210
    def test_require_versioned(self):
 
211
        # this does not quite robustly test, as it is passing in missing paths
 
212
        # rather than present-but-not-versioned paths. At the moment there is
 
213
        # no mechanism for managing the test trees (which are readonly) to 
 
214
        # get present-but-not-versioned files for trees that can do that.
 
215
        tree1 = self.make_branch_and_tree('1')
 
216
        tree2 = self.make_to_branch_and_tree('2')
 
217
        tree1 = self.get_tree_no_parents_no_content(tree1)
 
218
        tree2 = self.get_to_tree_no_parents_abc_content(tree2)
 
219
        self.assertRaises(errors.PathsNotVersionedError, 
 
220
            self.intertree_class(tree1, tree2).compare,
 
221
            specific_files=['d'],
 
222
            require_versioned=True)