/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 breezy/plugins/commitfromnews/tests/test_committemplate.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-07-15 12:50:24 UTC
  • mfrom: (7027.8.1 python3-commitfromnews)
  • Revision ID: breezy.the.bot@gmail.com-20180715125024-hxy4nuavy3bzobnb
Fix commitfromnews tests on python 3.

Merged from https://code.launchpad.net/~jelmer/brz/python3-commitfromnews/+merge/349619

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    )
26
26
from ....tests import TestCaseWithTransport
27
27
 
28
 
INITIAL_NEWS_CONTENT = """----------------------------
 
28
INITIAL_NEWS_CONTENT = b"""----------------------------
29
29
commitfromnews release notes
30
30
----------------------------
31
31
 
46
46
        self.commits.append(commit)
47
47
        self.messages.append(message)
48
48
        if message is None:
49
 
            message = 'let this commit succeed I command thee.'
 
49
            message = u'let this commit succeed I command thee.'
50
50
        return message
51
51
 
52
52
    def enable_commitfromnews(self):
67
67
        builder.start_series()
68
68
        builder.build_snapshot(None,
69
69
            [('add', ('', None, 'directory', None)),
70
 
             ('add', ('foo', b'foo-id', 'file', 'a\nb\nc\nd\ne\n')),
 
70
             ('add', ('foo', b'foo-id', 'file', b'a\nb\nc\nd\ne\n')),
71
71
             ],
72
72
            message_callback=msgeditor.generate_commit_message_template,
73
73
            revision_id=b'BASE-id')
87
87
            message_callback=msgeditor.generate_commit_message_template,
88
88
            revision_id=b'BASE-id')
89
89
        builder.finish_series()
90
 
        self.assertEqual([content], self.messages)
 
90
        self.assertEqual([content.decode('utf-8')], self.messages)
91
91
 
92
92
    def test_changed_NEWS(self):
93
93
        self.setup_capture()