~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_clean_tree.py

  • Committer: John Arbash Meinel
  • Date: 2011-07-18 14:22:20 UTC
  • mto: This revision was merged to the branch mainline in revision 6033.
  • Revision ID: john@arbash-meinel.com-20110718142220-nwylw659oip1ene9
Start at least testing the package_branch regex.
And start testing the is-up-to-date logic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2009, 2010, 2011 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
22
21
import sys
23
22
import types
24
23
 
47
46
        BzrDir.create_standalone_workingtree('branch')
48
47
        os.symlink(os.path.realpath('no-die-please'), 'branch/die-please')
49
48
        os.mkdir('no-die-please')
50
 
        self.failUnlessExists('branch/die-please')
 
49
        self.assertPathExists('branch/die-please')
51
50
        os.mkdir('no-die-please/child')
52
51
 
53
52
        clean_tree('branch', unknown=True, no_prompt=True)
54
 
        self.failUnlessExists('no-die-please')
55
 
        self.failUnlessExists('no-die-please/child')
 
53
        self.assertPathExists('no-die-please')
 
54
        self.assertPathExists('no-die-please/child')
56
55
 
57
56
    def test_iter_deletable(self):
58
57
        """Files are selected for deletion appropriately"""
99
98
        def _dummy_rmtree(path, ignore_errors=False, onerror=None):
100
99
            """Call user supplied error handler onerror.
101
100
            """
102
 
            self.assertTrue(isinstance(onerror, types.FunctionType))
103
101
            # Indicate failure in removing 'path' if path is subdir0
104
102
            # We later check to ensure that this is indicated
105
103
            # to the user as a warning. We raise OSError to construct