/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_textmerge.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-08 23:30:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170608233031-3qavls2o7a1pqllj
Update imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# Author: Aaron Bentley <aaron.bentley@utoronto.ca>
18
18
from breezy.textmerge import Merge2
19
19
from breezy.tests import TestCase
20
 
 
21
 
 
22
20
class TestMerge2(TestCase):
23
21
    def test_agreed(self):
24
22
        lines = "a\nb\nc\nd\ne\nf\n".splitlines(True)
31
29
        expected = "<\na\n=\nz\n>\nb\n<\nc\n=\nx\n>\nd\ne\n<\n=\ne\n>\nf\n"\
32
30
                   "g\n<\nh\n=\ny\n>\n"
33
31
        m2 = Merge2(lines_a, lines_b, '<\n', '>\n', '=\n')
34
 
        mlines = m2.merge_lines()[0]
 
32
        mlines= m2.merge_lines()[0]
35
33
        self.assertEqualDiff(''.join(mlines), expected)
36
 
        mlines = m2.merge_lines(reprocess=True)[0]
 
34
        mlines= m2.merge_lines(reprocess=True)[0]
37
35
        self.assertEqualDiff(''.join(mlines), expected)
38
36
 
39
37
    def test_reprocess(self):
40
 
        struct = [('a', 'b'), ('c',), ('def', 'geh'), ('i',)]
 
38
        struct = [('a', 'b'), ('c',), ('def','geh'), ('i',)]
41
39
        expect = [('a', 'b'), ('c',), ('d', 'g'), ('e',), ('f', 'h'), ('i',)]
42
40
        result = Merge2.reprocess_struct(struct)
43
41
        self.assertEqual(list(result), expect)