~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_tree.py

  • Committer: Andrew Bennetts
  • Date: 2007-03-26 06:24:01 UTC
  • mto: This revision was merged to the branch mainline in revision 2376.
  • Revision ID: andrew.bennetts@canonical.com-20070326062401-k3nbefzje5332jaf
Deal with review comments from Robert:

  * Add my name to the NEWS file
  * Move the test case to a new module in branch_implementations
  * Remove revision_history cruft from identitymap and test_identitymap
  * Improve some docstrings

Also, this fixes a bug where revision_history was not returning a copy of the
cached data, allowing the cache to be corrupted.

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
20
19
from bzrlib.tests import TestCaseWithTransport
21
20
from bzrlib.tree import InterTree
22
21
 
121
120
        delta = wt.changes_from(wt.basis_tree(), wt, include_root=True)
122
121
        self.assertEqual(len(delta.added), 1)
123
122
        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)