/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/tests/test_conflicts.py

  • Committer: Jelmer Vernooij
  • Date: 2018-06-21 23:59:28 UTC
  • mfrom: (6973.6.4 python3-e)
  • Revision ID: jelmer@jelmer.uk-20180621235928-f7z0vf0lxc6ieo9e
Merge lp:~jelmer/brz/python3-e

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    osutils,
25
25
    tests,
26
26
    )
 
27
from ..sixish import text_type
27
28
from . import (
28
29
    script,
29
30
    scenarios,
129
130
    scenarios = scenarios.multiply_scenarios(vary_by_conflicts())
130
131
 
131
132
    def test_stringification(self):
132
 
        text = unicode(self.conflict)
 
133
        text = text_type(self.conflict)
133
134
        self.assertContainsString(text, self.conflict.path)
134
135
        self.assertContainsString(text.lower(), "conflict")
135
136
        self.assertContainsString(repr(self.conflict),
140
141
        o = conflicts.Conflict.factory(**p.as_stanza().as_dict())
141
142
        self.assertEqual(o, p)
142
143
 
143
 
        self.assertIsInstance(o.path, unicode)
 
144
        self.assertIsInstance(o.path, text_type)
144
145
 
145
146
        if o.file_id is not None:
146
147
            self.assertIsInstance(o.file_id, str)
147
148
 
148
149
        conflict_path = getattr(o, 'conflict_path', None)
149
150
        if conflict_path is not None:
150
 
            self.assertIsInstance(conflict_path, unicode)
 
151
            self.assertIsInstance(conflict_path, text_type)
151
152
 
152
153
        conflict_file_id = getattr(o, 'conflict_file_id', None)
153
154
        if conflict_file_id is not None:
174
175
 
175
176
    def test_stringification(self):
176
177
        for text, o in zip(example_conflicts.to_strings(), example_conflicts):
177
 
            self.assertEqual(text, unicode(o))
 
178
            self.assertEqual(text, text_type(o))
178
179
 
179
180
 
180
181
# FIXME: The shell-like tests should be converted to real whitebox tests... or
303
304
 
304
305
        # Create an empty trunk
305
306
        builder.build_snapshot(None, [
306
 
                ('add', ('', 'root-id', 'directory', ''))],
 
307
                ('add', (u'', b'root-id', 'directory', ''))],
307
308
                revision_id=b'start')
308
309
        # Add a minimal base content
309
310
        base_actions = self._get_actions(self._base_actions)()
310
 
        builder.build_snapshot(['start'], base_actions, revision_id=b'base')
 
311
        builder.build_snapshot([b'start'], base_actions, revision_id=b'base')
311
312
        # Modify the base content in branch
312
313
        actions_other = self._get_actions(self._other['actions'])()
313
 
        builder.build_snapshot(['base'], actions_other, revision_id=b'other')
 
314
        builder.build_snapshot([b'base'], actions_other, revision_id=b'other')
314
315
        # Modify the base content in trunk
315
316
        actions_this = self._get_actions(self._this['actions'])()
316
 
        builder.build_snapshot(['base'], actions_this, revision_id=b'this')
 
317
        builder.build_snapshot([b'base'], actions_this, revision_id=b'this')
317
318
        # builder.get_branch() tip is now 'this'
318
319
 
319
320
        builder.finish_series()