~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_clean_tree.py

  • Committer: Aaron Bentley
  • Date: 2009-03-10 00:33:54 UTC
  • mto: This revision was merged to the branch mainline in revision 4100.
  • Revision ID: aaron@aaronbentley.com-20090310003354-d6t50ee6f5kjql48
Convert asserts to TestCase helper methods

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        BzrDir.create_standalone_workingtree('branch')
43
43
        os.symlink(os.path.realpath('no-die-please'), 'branch/die-please')
44
44
        os.mkdir('no-die-please')
45
 
        assert os.path.exists('branch/die-please')
 
45
        self.failUnlessExists('branch/die-please')
46
46
        os.mkdir('no-die-please/child')
47
47
 
48
48
        clean_tree('branch', unknown=True, no_prompt=True)
49
 
        assert os.path.exists('no-die-please')
50
 
        assert os.path.exists('no-die-please/child')
 
49
        self.failUnlessExists('no-die-please')
 
50
        self.failUnlessExists('no-die-please/child')
51
51
 
52
52
    def test_iter_deletable(self):
53
53
        """Files are selected for deletion appropriately"""
63
63
            transport.put_bytes('file~', 'contents')
64
64
            transport.put_bytes('file.pyc', 'contents')
65
65
            dels = sorted([r for a,r in iter_deletables(tree, unknown=True)])
66
 
            assert sorted(['file', 'file.BASE']) == dels
 
66
            self.assertEqual(['file', 'file.BASE'], dels)
67
67
 
68
68
            dels = [r for a,r in iter_deletables(tree, detritus=True)]
69
 
            assert sorted(['file~', 'file.BASE']) == dels
 
69
            self.assertEqual(sorted(['file~', 'file.BASE']), dels)
70
70
 
71
71
            dels = [r for a,r in iter_deletables(tree, ignored=True)]
72
 
            assert sorted(['file~', 'file.pyc', '.bzrignore']) == dels
 
72
            self.assertEqual(sorted(['file~', 'file.pyc', '.bzrignore']),
 
73
                             dels)
73
74
 
74
75
            dels = [r for a,r in iter_deletables(tree, unknown=False)]
75
 
            assert [] == dels
 
76
            self.assertEqual([], dels)
76
77
        finally:
77
78
            tree.unlock()