~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: 2008-10-12 15:26:50 UTC
  • mto: This revision was merged to the branch mainline in revision 3803.
  • Revision ID: aaron@aaronbentley.com-20081012152650-urs9hisrqa3qj3bk
Test Tree.get_file_text() and supply default implementation.

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_text(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 read by file-id
 
172
        self.assertEqual('foobar\n', tree.get_file_text('a-id'))
 
173
        # test read by path
 
174
        self.assertEqual('foobar\n', tree.get_file_text('a-id', path='a'))
 
175
 
166
176
 
167
177
class TestExtractFilesBytes(TestCaseWithTree):
168
178