/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/blackbox/test_cat.py

  • Committer: Robert Collins
  • Date: 2010-05-06 11:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506110810-h3j07fh5gmw54s25
Cleaner matcher matching revised unlocking protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
20
20
"""
21
21
 
22
22
import os
23
 
import sys
24
23
 
25
24
from bzrlib import tests
 
25
from bzrlib.transport import memory
26
26
 
27
27
 
28
28
class TestCat(tests.TestCaseWithTransport):
128
128
        out, err = self.run_bzr_subprocess(['cat', url])
129
129
        self.assertEqual('contents of README\n', out)
130
130
 
 
131
    def test_cat_branch_revspec(self):
 
132
        wt = self.make_branch_and_tree('a')
 
133
        self.build_tree(['a/README'])
 
134
        wt.add('README')
 
135
        wt.commit('Making sure there is a basis_tree available')
 
136
        wt = self.make_branch_and_tree('b')
 
137
        os.chdir('b')
 
138
 
 
139
        out, err = self.run_bzr_subprocess(
 
140
            ['cat', '-r', 'branch:../a', 'README'])
 
141
        self.assertEqual('contents of a/README\n', out)
 
142
 
131
143
    def test_cat_filters(self):
132
144
        wt = self.make_branch_and_tree('.')
133
145
        self.build_tree(['README'])
184
196
        self.assertEqual('contents of README\n', out)
185
197
 
186
198
    def test_cat_nonexistent_branch(self):
187
 
        self.vfs_transport_factory = tests.MemoryServer
 
199
        self.vfs_transport_factory = memory.MemoryServer
188
200
        self.run_bzr_error(['^bzr: ERROR: Not a branch'],
189
201
                           ['cat', self.get_url()])