15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
20
from bzrlib.tests.blackbox import ExternalBase
21
21
from bzrlib.workingtree import WorkingTree
110
110
self.assertEquals(out.strip(), "")
111
111
self.assertEquals(err.strip(), "b is not versioned.")
113
def test_rm_one_file(self):
114
tree = self._make_add_and_assert_tree([a])
115
self.run_bzr_captured(['commit', '-m', 'added a'])
116
(out, err) = self.run_bzr_captured(['rm', 'a'])
117
self.assertEquals(out.strip(), "")
118
self.assertEquals(err.strip(), "deleted a")
119
self.assertFilesDeleted([a])
113
121
def test_remove_one_file(self):
114
122
tree = self._make_add_and_assert_tree([a])
123
self.run_bzr_captured(['commit', '-m', 'added a'])
115
124
(out, err) = self.run_bzr_captured(['remove', 'a'])
116
125
self.assertEquals(out.strip(), "")
117
self.assertEquals(err.strip(), "a has changed and won't be deleted.")
118
self.assertFilesUnversioned([a])
126
self.assertEquals(err.strip(), "deleted a")
127
self.assertFilesDeleted([a])
120
129
def test_remove_keep_one_file(self):
121
130
tree = self._make_add_and_assert_tree([a])
122
131
(out, err) = self.run_bzr_captured(['remove', '--keep', 'a'])
124
133
self.assertEquals(err.strip(), "removed a")
125
134
self.assertFilesUnversioned([a])
136
def test_remove_files(self):
137
tree = self._make_add_and_assert_tree(files)
138
self.run_bzr_captured(['commit', '-m', 'added files'])
139
(out, err) = self.run_bzr_captured(['remove', a, b, c])
140
self.assertEquals(out.strip(), "")
141
self.assertTrue(re.search("deleted a", err))
142
self.assertTrue(re.search("deleted b", err))
143
self.assertTrue(re.search("deleted b/c", err))
144
self.assertFilesDeleted(files)
146
def test_remove_keep_files(self):
147
tree = self._make_add_and_assert_tree(files)
148
(out, err) = self.run_bzr_captured(['remove', '--keep', a, b, c])
149
self.assertEquals(out.strip(), "")
150
self.assertTrue(re.search("removed a", err))
151
self.assertTrue(re.search("removed b", err))
152
self.assertTrue(re.search("removed b/c", err))
153
self.assertFilesUnversioned(files)
127
155
def test_command_on_deleted(self):
128
156
tree = self._make_add_and_assert_tree([a])
129
157
self.run_bzr_captured(['commit', '-m', 'added a'])