~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Alexander Belchenko
  • Date: 2006-12-19 08:26:36 UTC
  • mfrom: (2198 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2204.
  • Revision ID: bialix@ukr.net-20061219082636-xbb55np3wnamva8t
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.errors import ParamikoNotPresent
28
28
from bzrlib.tests import (
29
29
                          TestCase,
 
30
                          TestCaseInTempDir,
30
31
                          TestCaseWithMemoryTransport,
31
32
                          TestCaseWithTransport,
32
33
                          TestSkipped,
451
452
 
452
453
        out, err = self.run_bzr_error(["bzr: ERROR: foobarbaz is not versioned"],
453
454
                                      'file-id', 'foobarbaz')
 
455
 
 
456
 
 
457
class TestSelftestCleanOutput(TestCaseInTempDir):
 
458
 
 
459
    def test_clean_output(self):
 
460
        # check that 'bzr selftest --clean-output' works correct
 
461
        dirs = ('test0000.tmp', 'test0001.tmp', 'bzrlib', 'tests')
 
462
        files = ('bzr', 'setup.py', 'test9999.tmp')
 
463
        for i in dirs:
 
464
            os.mkdir(i)
 
465
        for i in files:
 
466
            f = file(i, 'wb')
 
467
            f.write('content of ')
 
468
            f.write(i)
 
469
            f.close()
 
470
 
 
471
        root = os.getcwdu()
 
472
        before = os.listdir(root)
 
473
        before.sort()
 
474
        self.assertEquals(['bzr','bzrlib','setup.py',
 
475
                           'test0000.tmp','test0001.tmp',
 
476
                           'test9999.tmp','tests'],
 
477
                           before)
 
478
 
 
479
        out,err = self.run_bzr_captured(['selftest','--clean-output'],
 
480
                                        working_dir=root)
 
481
 
 
482
        self.assertEquals(['delete directory: test0000.tmp',
 
483
                          'delete directory: test0001.tmp'],
 
484
                          sorted(out.splitlines()))
 
485
        self.assertEquals('', err)
 
486
 
 
487
        after = os.listdir(root)
 
488
        after.sort()
 
489
        self.assertEquals(['bzr','bzrlib','setup.py',
 
490
                           'test9999.tmp','tests'],
 
491
                           after)