~abentley/bzr/last-revision

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-05-28 14:25:00 UTC
  • mfrom: (4354.4.9 commit-preview)
  • mto: This revision was merged to the branch mainline in revision 4378.
  • Revision ID: pqm@pqm.ubuntu.com-20090528142500-n7ki7gucmkxzx611
(abentley) move get_file_with_stat from MutableTree to Tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
21
 
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
22
 
 
23
 
 
24
 
class TestGetFileWithStat(TestCaseWithWorkingTree):
 
21
from bzrlib.tests.tree_implementations import TestCaseWithTree
 
22
 
 
23
 
 
24
class TestGetFileWithStat(TestCaseWithTree):
25
25
 
26
26
    def test_get_file_with_stat_id_only(self):
27
 
        tree = self.make_branch_and_tree('.')
 
27
        work_tree = self.make_branch_and_tree('.')
28
28
        self.build_tree(['foo'])
29
 
        tree.add(['foo'], ['foo-id'])
 
29
        work_tree.add(['foo'], ['foo-id'])
 
30
        tree = self._convert_tree(work_tree)
30
31
        tree.lock_read()
31
32
        self.addCleanup(tree.unlock)
32
33
        file_obj, statvalue = tree.get_file_with_stat('foo-id')
36
37
        self.assertEqual(["contents of foo\n"], file_obj.readlines())
37
38
 
38
39
    def test_get_file_with_stat_id_and_path(self):
39
 
        tree = self.make_branch_and_tree('.')
 
40
        work_tree = self.make_branch_and_tree('.')
40
41
        self.build_tree(['foo'])
41
 
        tree.add(['foo'], ['foo-id'])
 
42
        work_tree.add(['foo'], ['foo-id'])
 
43
        tree = self._convert_tree(work_tree)
42
44
        tree.lock_read()
43
45
        self.addCleanup(tree.unlock)
44
46
        file_obj, statvalue = tree.get_file_with_stat('foo-id', 'foo')