~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/tree_implementations/test_tree.py

  • Committer: Aaron Bentley
  • Date: 2009-05-21 12:16:23 UTC
  • mto: This revision was merged to the branch mainline in revision 4386.
  • Revision ID: aaron@aaronbentley.com-20090521121623-e5cld07a69n1o1gg
Move MutableTree.get_file_with_stat to Tree.get_file_with_stat.

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
        finally:
164
164
            tree.unlock()
165
165
 
166
 
    def test_get_file_with_stat(self):
167
 
        work_tree = self.make_branch_and_tree('wt')
168
 
        tree = self.get_tree_no_parents_abc_content_2(work_tree)
169
 
        tree.lock_read()
170
 
        self.addCleanup(tree.unlock)
171
 
        # Test lookup without path works
172
 
        tree_file, stat = tree.get_file_with_stat('a-id')
173
 
        # We should get None or a stat value.
174
 
        self.assertTrue(stat is None or len(stat) == 10)
175
 
        lines = tree_file.readlines()
176
 
        self.assertEqual(['foobar\n'], lines)
177
 
        # Test lookup with path works
178
 
        lines = tree.get_file_with_stat('a-id', path='a')[0].readlines()
179
 
        self.assertEqual(['foobar\n'], lines)
180
 
 
181
166
    def test_get_file_text(self):
182
167
        work_tree = self.make_branch_and_tree('wt')
183
168
        tree = self.get_tree_no_parents_abc_content_2(work_tree)