~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

Change the use of run_bzr to run_bzr_captured in blackbox tests - inspired by David Clymers patch to change run_bzr usage to runbzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
34
34
from bzrlib.branch import Branch
35
 
from bzrlib.commands import run_bzr
36
35
 
37
36
 
38
37
class ExternalBase(TestCaseInTempDir):
 
38
 
39
39
    def runbzr(self, args, retcode=0, backtick=False):
40
40
        if isinstance(args, basestring):
41
41
            args = args.split()
170
170
        from bzrlib.branch import Branch
171
171
        b = Branch.initialize('.')
172
172
        self.build_tree(['a', 'c', 'subdir/'])
173
 
        self.run_bzr('add', self.test_dir)
174
 
        self.run_bzr('mv', 'a', 'b')
175
 
        self.run_bzr('mv', 'b', 'subdir')
176
 
        self.run_bzr('mv', 'subdir/b', 'a')
177
 
        self.run_bzr('mv', 'a', 'c', 'subdir')
178
 
        self.run_bzr('mv', 'subdir/a', 'subdir/newa')
 
173
        self.run_bzr_captured(['add', self.test_dir])
 
174
        self.run_bzr_captured(['mv', 'a', 'b'])
 
175
        self.run_bzr_captured(['mv', 'b', 'subdir'])
 
176
        self.run_bzr_captured(['mv', 'subdir/b', 'a'])
 
177
        self.run_bzr_captured(['mv', 'a', 'c', 'subdir'])
 
178
        self.run_bzr_captured(['mv', 'subdir/a', 'subdir/newa'])
179
179
 
180
180
 
181
181
    def test_main_version(self):
287
287
        """add command prints the names of added files."""
288
288
        b = Branch.initialize('.')
289
289
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt'])
290
 
        out = StringIO()
291
 
        ret = self.apply_redirected(None, out, None,
292
 
                                    run_bzr,
293
 
                                    ['add'])
294
 
        self.assertEquals(ret, 0)
 
290
        out = self.run_bzr_captured(['add'], retcode = 0)[0]
295
291
        # the ordering is not defined at the moment
296
 
        results = sorted(out.getvalue().rstrip('\n').split('\n'))
 
292
        results = sorted(out.rstrip('\n').split('\n'))
297
293
        self.assertEquals(['added dir',
298
294
                           'added dir/sub.txt',
299
295
                           'added top.txt',],