1
# Copyright (C) 2005, 2009 Canonical Ltd
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
"""Tests of the 'bzr clean-tree' command."""
24
from bzrlib.tests import TestCaseWithTransport
27
class TestBzrTools(TestCaseWithTransport):
31
my_file = open(filename, 'wb')
37
def test_clean_tree(self):
39
self.run_bzr('ignore *~')
40
self.run_bzr('ignore *.pyc')
43
self.failUnlessExists('name~')
44
self.touch('name.pyc')
45
self.run_bzr('clean-tree --force')
46
self.failUnlessExists('name~')
47
self.failIfExists('name')
49
self.run_bzr('clean-tree --detritus --force')
50
self.failUnlessExists('name')
51
self.failIfExists('name~')
52
self.failUnlessExists('name.pyc')
53
self.run_bzr('clean-tree --ignored --force')
54
self.failUnlessExists('name')
55
self.failIfExists('name.pyc')
56
self.run_bzr('clean-tree --unknown --force')
57
self.failIfExists('name')
60
self.touch('name.pyc')
61
self.run_bzr('clean-tree --unknown --ignored --force')
62
self.failIfExists('name')
63
self.failIfExists('name~')
64
self.failIfExists('name.pyc')