~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_clean_tree.py

  • Committer: Andrew Bennetts
  • Date: 2010-11-22 03:35:24 UTC
  • mto: This revision was merged to the branch mainline in revision 5547.
  • Revision ID: andrew.bennetts@canonical.com-20101122033524-ouxj0onm3gtkimx3
Remove RepositoryFormatCHK1 and RepositoryFormatCHK2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010, 2011 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
18
18
import errno
19
19
import os
20
20
import shutil
 
21
from StringIO import StringIO
21
22
import sys
22
23
import types
23
24
 
46
47
        BzrDir.create_standalone_workingtree('branch')
47
48
        os.symlink(os.path.realpath('no-die-please'), 'branch/die-please')
48
49
        os.mkdir('no-die-please')
49
 
        self.assertPathExists('branch/die-please')
 
50
        self.failUnlessExists('branch/die-please')
50
51
        os.mkdir('no-die-please/child')
51
52
 
52
53
        clean_tree('branch', unknown=True, no_prompt=True)
53
 
        self.assertPathExists('no-die-please')
54
 
        self.assertPathExists('no-die-please/child')
 
54
        self.failUnlessExists('no-die-please')
 
55
        self.failUnlessExists('no-die-please/child')
55
56
 
56
57
    def test_iter_deletable(self):
57
58
        """Files are selected for deletion appropriately"""
98
99
        def _dummy_rmtree(path, ignore_errors=False, onerror=None):
99
100
            """Call user supplied error handler onerror.
100
101
            """
 
102
            self.assertTrue(isinstance(onerror, types.FunctionType))
101
103
            # Indicate failure in removing 'path' if path is subdir0
102
104
            # We later check to ensure that this is indicated
103
105
            # to the user as a warning. We raise OSError to construct