~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_msgeditor.py

(jr) New hook set_commit_message in bzrlib.msgeditor to set a commit message
 and revision properties. (Jonathan Riddell, #274578) (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
344
344
        self.assertRaises(errors.BadCommitMessageEncoding,
345
345
                          msgeditor.edit_commit_message, '')
346
346
 
 
347
    def test_set_commit_message_no_hooks(self):
 
348
        commit_obj = commit.Commit()
 
349
        self.assertIs(None,
 
350
            msgeditor.set_commit_message(commit_obj))
 
351
 
 
352
    def test_set_commit_message_hook(self):
 
353
        msgeditor.hooks.install_named_hook("set_commit_message",
 
354
                lambda commit_obj, existing_message: "save me some typing\n", None)
 
355
        commit_obj = commit.Commit()
 
356
        self.assertEquals("save me some typing\n",
 
357
            msgeditor.set_commit_message(commit_obj))
 
358
 
347
359
    def test_generate_commit_message_template_no_hooks(self):
348
360
        commit_obj = commit.Commit()
349
361
        self.assertIs(None,