~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Marius Kruger
  • Date: 2010-07-10 21:03:02 UTC
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100710210302-o0081gfn0zllhrf1
* extract backup_files
* factor out common backup code in workingtree.remove

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
    files = ['a', 'b/', 'b/c', 'd/']
26
26
    rfiles = ['b/c', 'b', 'a', 'd']
 
27
    backup_files = ['a.~1~', 'b.~1~/', 'b.~1~/c.~1~', 'd.~1~/']
27
28
 
28
29
    def get_tree(self, files):
29
30
        tree = self.make_branch_and_tree('.')
78
79
        self.assertInWorkingTree(TestRemove.files)
79
80
        tree.remove(TestRemove.files, keep_files=False)
80
81
        self.assertNotInWorkingTree(TestRemove.files)
81
 
        self.failUnlessExists(['a.~1~', 'b.~1~/', 'b.~1~/c.~1~', 'd.~1~/'])
 
82
        self.failUnlessExists(TestRemove.backup_files)
82
83
        tree._validate()
83
84
 
84
85
    def test_remove_changed_file(self):
150
151
        tree = self.get_tree(TestRemove.files)
151
152
        tree.remove(TestRemove.files, keep_files=False)
152
153
        self.assertRemovedAndDeleted(TestRemove.files)
153
 
        self.failUnlessExists(['a.~1~', 'b.~1~/', 'b.~1~/c.~1~', 'd.~1~/'])
 
154
        self.failUnlessExists(TestRemove.backup_files)
154
155
        tree._validate()
155
156
 
156
157
    def test_remove_nonexisting_files(self):