/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/selftest/test_commit.py

  • Committer: Martin Pool
  • Date: 2005-09-14 06:18:18 UTC
  • Revision ID: mbp@sourcefrog.net-20050914061818-05a79652196cc758
- tests for deletion and removal of files in commits

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
    def test_delete_commit(self):
52
52
        """Test a commit with a deleted file"""
 
53
        b = Branch('.', init=True)
 
54
        file('hello', 'w').write('hello world')
 
55
        b.add(['hello'], ['hello-id'])
 
56
        b.commit(message='add hello')
 
57
 
 
58
        os.remove('hello')
 
59
        b.commit('removed hello', rev_id='rev2')
 
60
 
 
61
        tree = b.revision_tree('rev2')
 
62
        self.assertFalse(tree.has_id('hello-id'))
 
63
 
53
64
 
54
65
    def test_removed_commit(self):
55
66
        """Test a commit with a removed file"""
 
67
        b = Branch('.', init=True)
 
68
        file('hello', 'w').write('hello world')
 
69
        b.add(['hello'], ['hello-id'])
 
70
        b.commit(message='add hello')
 
71
 
 
72
        b.remove('hello')
 
73
        b.commit('removed hello', rev_id='rev2')
 
74
 
 
75
        tree = b.revision_tree('rev2')
 
76
        self.assertFalse(tree.has_id('hello-id'))
56
77
 
57
78
 
58
79
if __name__ == '__main__':