~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_msgeditor.py

  • Committer: ghigo
  • Date: 2007-08-17 17:44:15 UTC
  • mto: (2772.1.1 show-diff)
  • mto: This revision was merged to the branch mainline in revision 2773.
  • Revision ID: ghigo@venice-20070817174415-z9uufl65de5qhvqp
update on the basis of Aaron suggestions

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import bzrlib.msgeditor 
26
26
from bzrlib.tests import TestCaseWithTransport, TestSkipped
27
27
from bzrlib.trace import mutter
28
 
 
 
28
from bzrlib.msgeditor import (
 
29
    make_commit_message_template_encoded,
 
30
)
29
31
 
30
32
class MsgEditorTest(TestCaseWithTransport):
31
33
 
45
47
    def test_commit_template(self):
46
48
        """Test building a commit message template"""
47
49
        working_tree = self.make_uncommitted_tree()
48
 
        template = bzrlib.msgeditor.make_commit_message_template(working_tree, None)
 
50
        template = bzrlib.msgeditor.make_commit_message_template(working_tree,
 
51
                                                                 None)
49
52
        self.assertEqualDiff(template,
50
53
u"""\
51
54
added:
55
58
    def test_commit_template_encoded(self):
56
59
        """Test building a commit message template"""
57
60
        working_tree = self.make_uncommitted_tree()
58
 
        template = bzrlib.msgeditor.make_commit_message_template_encoded(working_tree,
59
 
                                                     None,
60
 
                                                     output_encoding='utf8')
 
61
        template = make_commit_message_template_encoded(working_tree,
 
62
                                                        None,
 
63
                                                        output_encoding='utf8')
61
64
        self.assertEqualDiff(template,
62
65
u"""\
63
66
added:
68
71
    def test_commit_template_and_diff(self):
69
72
        """Test building a commit message template"""
70
73
        working_tree = self.make_uncommitted_tree()
71
 
        template = bzrlib.msgeditor.make_commit_message_template_encoded(working_tree,
72
 
                                                     None, diff=True,
73
 
                                                     output_encoding='utf8')
 
74
        template = make_commit_message_template_encoded(working_tree,
 
75
                                                        None,
 
76
                                                        diff=True,
 
77
                                                        output_encoding='utf8')
74
78
 
75
79
        self.assertTrue("""\
76
80
@@ -0,0 +1,1 @@