~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
472
472
                ['file-id', 'foobarbaz'])
473
473
 
474
474
 
475
 
class TestSelftestCleanOutput(TestCaseInTempDir):
476
 
 
477
 
    def test_clean_output(self):
478
 
        # check that 'bzr selftest --clean-output' works correct
479
 
        dirs = ('test0000.tmp', 'test0001.tmp', 'bzrlib', 'tests')
480
 
        files = ('bzr', 'setup.py', 'test9999.tmp')
481
 
        for i in dirs:
482
 
            os.mkdir(i)
483
 
        for i in files:
484
 
            f = file(i, 'wb')
485
 
            f.write('content of ')
486
 
            f.write(i)
487
 
            f.close()
488
 
 
489
 
        root = os.getcwdu()
490
 
        before = os.listdir(root)
491
 
        before.sort()
492
 
        self.assertEquals(['bzr','bzrlib','setup.py',
493
 
                           'test0000.tmp','test0001.tmp',
494
 
                           'test9999.tmp','tests'],
495
 
                           before)
496
 
 
497
 
        out, err = self.run_bzr('selftest --clean-output',
498
 
                                working_dir=root)
499
 
 
500
 
        self.assertEquals(['delete directory: test0000.tmp',
501
 
                          'delete directory: test0001.tmp'],
502
 
                          sorted(out.splitlines()))
503
 
        self.assertEquals('', err)
504
 
 
505
 
        after = os.listdir(root)
506
 
        after.sort()
507
 
        self.assertEquals(['bzr','bzrlib','setup.py',
508
 
                           'test9999.tmp','tests'],
509
 
                           after)
510
 
 
511
 
 
512
475
class TestSelftestListOnly(TestCase):
513
476
 
514
477
    @staticmethod