~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Martin Pool
  • Date: 2005-08-30 05:35:11 UTC
  • Revision ID: mbp@sourcefrog.net-20050830053511-71f6b3ba8ca93827
- add new Branch.set_parent and tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
"""
28
28
 
29
29
import sys
30
 
 
31
30
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
32
 
from bzrlib.branch import Branch
33
 
from bzrlib.commands import run_bzr
34
 
 
35
31
 
36
32
class ExternalBase(TestCaseInTempDir):
37
33
    def runbzr(self, args, retcode=0,backtick=False):
219
215
        a.get_revision_xml(b.last_patch())
220
216
 
221
217
        self.log('pending merges: %s', a.pending_merges())
222
 
        #        assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
223
 
        #        % (a.pending_merges(), b.last_patch())
224
 
 
225
 
 
226
 
    def test_add_reports(self):
227
 
        """add command prints the names of added files."""
228
 
        b = Branch('.', init=True)
229
 
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt'])
230
 
 
231
 
        from cStringIO import StringIO
232
 
        out = StringIO()
233
 
 
234
 
        ret = self.apply_redirected(None, out, None,
235
 
                                    run_bzr,
236
 
                                    ['add'])
237
 
        self.assertEquals(ret, 0)
238
 
 
239
 
        # the ordering is not defined at the moment
240
 
        results = sorted(out.getvalue().rstrip('\n').split('\n'))
241
 
        self.assertEquals(['added dir',
242
 
                           'added dir/sub.txt',
243
 
                           'added top.txt',],
244
 
                          results)
245
 
 
 
218
#        assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
 
219
#        % (a.pending_merges(), b.last_patch())
246
220
 
247
221
class OldTests(ExternalBase):
248
222
    """old tests moved from ./testbzr."""