~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_cat.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-14 00:01:32 UTC
  • mfrom: (4957.1.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100114000132-3p3rabnonjw3gzqb
(jam) Merge bzr.stable, bringing in bug fixes #175839, #504390

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
"""
21
21
 
22
22
import os
23
 
import sys
24
 
 
25
 
from bzrlib.tests.blackbox import TestCaseWithTransport
26
 
 
27
 
class TestCat(TestCaseWithTransport):
 
23
 
 
24
from bzrlib import tests
 
25
 
 
26
 
 
27
class TestCat(tests.TestCaseWithTransport):
28
28
 
29
29
    def test_cat(self):
30
30
        tree = self.make_branch_and_tree('branch')
68
68
 
69
69
    def test_cat_different_id(self):
70
70
        """'cat' works with old and new files"""
 
71
        self.disable_missing_extensions_warning()
71
72
        tree = self.make_branch_and_tree('.')
72
73
        # the files are named after their path in the revision and
73
74
        # current trees later in the test case
126
127
        out, err = self.run_bzr_subprocess(['cat', url])
127
128
        self.assertEqual('contents of README\n', out)
128
129
 
 
130
    def test_cat_branch_revspec(self):
 
131
        wt = self.make_branch_and_tree('a')
 
132
        self.build_tree(['a/README'])
 
133
        wt.add('README')
 
134
        wt.commit('Making sure there is a basis_tree available')
 
135
        wt = self.make_branch_and_tree('b')
 
136
        os.chdir('b')
 
137
 
 
138
        out, err = self.run_bzr_subprocess(
 
139
            ['cat', '-r', 'branch:../a', 'README'])
 
140
        self.assertEqual('contents of a/README\n', out)
 
141
 
129
142
    def test_cat_filters(self):
130
143
        wt = self.make_branch_and_tree('.')
131
144
        self.build_tree(['README'])
182
195
        self.assertEqual('contents of README\n', out)
183
196
 
184
197
    def test_cat_nonexistent_branch(self):
185
 
        if sys.platform == "win32":
186
 
            location = "C:/i/do/not/exist"
187
 
        else:
188
 
            location = "/i/do/not/exist"
189
 
        self.run_bzr_error(['^bzr: ERROR: Not a branch'], ['cat', location])
 
198
        self.vfs_transport_factory = tests.MemoryServer
 
199
        self.run_bzr_error(['^bzr: ERROR: Not a branch'],
 
200
                           ['cat', self.get_url()])