/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2009-06-10 02:51:23 UTC
  • mfrom: (4423 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4464.
  • Revision ID: mbp@sourcefrog.net-20090610025123-2u0c0ng5jcezjzqh
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Test that all WorkingTree's implement get_file_with_stat."""
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')