~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_tree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-08-07 07:17:34 UTC
  • mfrom: (2675.1.2 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070807071734-qrnzeyjktp2f7022
(Marius Kruger) InterTree.compare doesn't pass require_versioned on correctly

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for Tree and InterTree."""
18
18
 
 
19
from bzrlib import errors
19
20
from bzrlib.tests import TestCaseWithTransport
20
21
from bzrlib.tree import InterTree
21
22
 
120
121
        delta = wt.changes_from(wt.basis_tree(), wt, include_root=True)
121
122
        self.assertEqual(len(delta.added), 1)
122
123
        self.assertEqual(delta.added[0][0], '')
 
124
 
 
125
    def test_changes_from_with_require_versioned(self):
 
126
        """Ensure the require_versioned option does what's expected."""
 
127
        wt = self.make_branch_and_tree('.')
 
128
        self.build_tree(['known_file', 'unknown_file'])
 
129
        wt.add('known_file')
 
130
 
 
131
        self.assertRaises(errors.PathsNotVersionedError,
 
132
            wt.changes_from, wt.basis_tree(), wt, specific_files=['known_file',
 
133
            'unknown_file'], require_versioned=True)
 
134
 
 
135
        # we need to pass a known file with an unknown file to get this to
 
136
        # fail when expected.
 
137
        delta = wt.changes_from(wt.basis_tree(), wt, 
 
138
            specific_files=['known_file', 'unknown_file'] ,
 
139
            require_versioned=False)
 
140
        self.assertEqual(len(delta.added), 1)