~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/test_commit.py

[merge] Fixes and tests for strict commits (mpe)

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
        self.assertRaises(StrictCommitFailed, b.commit,
277
277
            message='add hello but not goodbye', strict=True)
278
278
 
 
279
    def test_strict_commit_without_unknowns(self):
 
280
        """Try and commit with no unknown files and strict = True,
 
281
        should work."""
 
282
        from bzrlib.errors import StrictCommitFailed
 
283
        b = Branch.initialize('.')
 
284
        file('hello', 'w').write('hello world')
 
285
        b.add('hello')
 
286
        b.commit(message='add hello', strict=True)
 
287
 
279
288
    def test_nonstrict_commit(self):
280
289
        """Try and commit with unknown files and strict = False, should work."""
281
290
        b = Branch.initialize('.')
284
293
        file('goodbye', 'w').write('goodbye cruel world!')
285
294
        b.commit(message='add hello but not goodbye', strict=False)
286
295
 
 
296
    def test_nonstrict_commit_without_unknowns(self):
 
297
        """Try and commit with no unknown files and strict = False,
 
298
        should work."""
 
299
        b = Branch.initialize('.')
 
300
        file('hello', 'w').write('hello world')
 
301
        b.add('hello')
 
302
        b.commit(message='add hello', strict=False)
 
303
 
287
304
    def test_signed_commit(self):
288
305
        import bzrlib.gpg
289
306
        import bzrlib.commit as commit