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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-06-30 23:11:39 UTC
  • mfrom: (6973.12.13 python3-k)
  • Revision ID: breezy.the.bot@gmail.com-20180630231139-tf5t5khh6bu5ntpm
Fix some more tests on python3.

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
816
816
        self.build_tree(['new-tree/new-dir/'])
817
817
        self.new_tree.add('new-dir', b'new-dir-id')
818
818
        self.differ.diff(b'new-dir-id', None, 'new-dir')
819
 
        self.assertEqual(self.differ.to_file.getvalue(), '')
 
819
        self.assertEqual(self.differ.to_file.getvalue(), b'')
820
820
 
821
821
    def create_old_new(self):
822
822
        self.build_tree_contents([('old-tree/olddir/',),
1291
1291
            _patiencediff_py.PatienceSequenceMatcher_py
1292
1292
 
1293
1293
    def test_patience_unified_diff_files(self):
1294
 
        txt_a = ['hello there\n',
1295
 
                 'world\n',
1296
 
                 'how are you today?\n']
1297
 
        txt_b = ['hello there\n',
1298
 
                 'how are you today?\n']
 
1294
        txt_a = [b'hello there\n',
 
1295
                 b'world\n',
 
1296
                 b'how are you today?\n']
 
1297
        txt_b = [b'hello there\n',
 
1298
                 b'how are you today?\n']
1299
1299
        with open('a1', 'wb') as f: f.writelines(txt_a)
1300
1300
        with open('b1', 'wb') as f: f.writelines(txt_b)
1301
1301
 
1430
1430
                                     None, None, output)
1431
1431
        self.addCleanup(diff_obj.finish)
1432
1432
        diff_obj._execute('old', 'new')
1433
 
        self.assertEqual(output.getvalue().rstrip(), 'old new')
 
1433
        self.assertEqual(output.getvalue().rstrip(), b'old new')
1434
1434
 
1435
1435
    def test_execute_missing(self):
1436
1436
        diff_obj = diff.DiffFromTool(['a-tool-which-is-unlikely-to-exist'],