~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                          TestUtil,
51
51
                          TextTestRunner,
52
52
                          UnavailableFeature,
53
 
                          clean_selftest_output,
54
53
                          iter_suite_tests,
55
54
                          filter_suite_by_re,
56
55
                          sort_suite_by_re,
1512
1511
        self.assertEqual([True], factory_called)
1513
1512
 
1514
1513
 
1515
 
class TestSelftestCleanOutput(TestCaseInTempDir):
1516
 
 
1517
 
    def test_clean_output(self):
1518
 
        # test functionality of clean_selftest_output()
1519
 
        self.build_tree(['test0000.tmp/', 'test0001.tmp/',
1520
 
                         'bzrlib/', 'tests/',
1521
 
                         'bzr', 'setup.py', 'test9999.tmp'])
1522
 
 
1523
 
        root = os.getcwdu()
1524
 
        before = os.listdir(root)
1525
 
        before.sort()
1526
 
        self.assertEquals(['bzr','bzrlib','setup.py',
1527
 
                           'test0000.tmp','test0001.tmp',
1528
 
                           'test9999.tmp','tests'],
1529
 
                           before)
1530
 
        clean_selftest_output(root, quiet=True)
1531
 
        after = os.listdir(root)
1532
 
        after.sort()
1533
 
        self.assertEquals(['bzr','bzrlib','setup.py',
1534
 
                           'test9999.tmp','tests'],
1535
 
                           after)
1536
 
 
1537
 
    def test_clean_readonly(self):
1538
 
        # test for delete read-only files
1539
 
        self.build_tree(['test0000.tmp/', 'test0000.tmp/foo'])
1540
 
        osutils.make_readonly('test0000.tmp/foo')
1541
 
        root = os.getcwdu()
1542
 
        before = os.listdir(root);  before.sort()
1543
 
        self.assertEquals(['test0000.tmp'], before)
1544
 
        clean_selftest_output(root, quiet=True)
1545
 
        after = os.listdir(root);   after.sort()
1546
 
        self.assertEquals([], after)
1547
 
 
1548
 
 
1549
1514
class TestKnownFailure(TestCase):
1550
1515
 
1551
1516
    def test_known_failure(self):