~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_remove.py

  • Committer: Marius Kruger
  • Date: 2007-04-12 00:47:48 UTC
  • mto: This revision was merged to the branch mainline in revision 2455.
  • Revision ID: amanic@gmail.com-20070412004748-0nsa6sughf0xu744
* merge the unversion command back into the remove command,
  merging the commands and tests.
* make all tests pass again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
2
 
#
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.
7
 
#
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.
12
 
#
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
 
 
17
 
 
18
 
import os
19
 
 
20
 
from bzrlib.tests.blackbox.test_unversion import TestUnversion
21
 
from bzrlib.workingtree import WorkingTree
22
 
 
23
 
 
24
 
class TestRemove(TestUnversion):
25
 
 
26
 
    def __init__(self, methodName='runTest'):
27
 
        super(TestRemove, self).__init__(methodName)
28
 
        self.cmd = 'remove'
29
 
        self.shape = None
30
 
 
31
 
    def assertCommandPerformedOnFiles(self,files):
32
 
        for f in files:
33
 
            self.failIfExists(f)
34
 
            self.assertNotInWorkingTree(f)
35
 
 
36
 
    def test_command_on_unversioned_files(self):
37
 
        self.build_tree(['a'])
38
 
        tree = self.make_branch_and_tree('.')
39
 
 
40
 
        (out,err) = self.runbzr(self.cmd + ' a')
41
 
        self.assertEquals(out.strip(), "")
42
 
        self.assertEquals(err.strip(), "deleted a")
43
 
 
44
 
    def test_command_on_non_existing_files(self):
45
 
        tree = self._make_add_and_assert_tree([])
46
 
        (out,err) = self.runbzr(self.cmd + ' b')
47
 
        self.assertEquals(out.strip(), "")
48
 
        self.assertEquals(err.strip(), "b does not exist.")