~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
        tree = self.create_nested()
106
106
        tree.lock_read()
107
107
        self.addCleanup(tree.unlock)
108
 
        entry = tree.inventory['sub-root']
 
108
        entry = tree.root_inventory['sub-root']
109
109
        self.assertEqual([(u'subtree', 'sub-root')],
110
110
            list(tree.iter_references()))
111
111
 
158
158
        work_tree = self.make_branch_and_tree('wt')
159
159
        tree = self.get_tree_no_parents_abc_content_2(work_tree)
160
160
        tree.lock_read()
161
 
        try:
162
 
            # Test lookup without path works
163
 
            lines = tree.get_file('a-id').readlines()
164
 
            self.assertEqual(['foobar\n'], lines)
165
 
            # Test lookup with path works
166
 
            lines = tree.get_file('a-id', path='a').readlines()
167
 
            self.assertEqual(['foobar\n'], lines)
168
 
        finally:
169
 
            tree.unlock()
 
161
        self.addCleanup(tree.unlock)
 
162
        # Test lookup without path works
 
163
        file_without_path = tree.get_file('a-id')
 
164
        try:
 
165
            lines = file_without_path.readlines()
 
166
            self.assertEqual(['foobar\n'], lines)
 
167
        finally:
 
168
            file_without_path.close()
 
169
        # Test lookup with path works
 
170
        file_with_path = tree.get_file('a-id', path='a')
 
171
        try:
 
172
            lines = file_with_path.readlines()
 
173
            self.assertEqual(['foobar\n'], lines)
 
174
        finally:
 
175
            file_with_path.close()
170
176
 
171
177
    def test_get_file_text(self):
172
178
        work_tree = self.make_branch_and_tree('wt')