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

  • Committer: Jelmer Vernooij
  • Date: 2018-06-22 00:52:45 UTC
  • mfrom: (6973.7.4 python3-f)
  • Revision ID: jelmer@jelmer.uk-20180622005245-0q92vv00fy9ouyqv
Merge lp:~jelmer/brz/python3-f

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
        tree1.lock_read()
103
103
        text = tree1.get_file_text('hello')
104
104
        tree1.unlock()
105
 
        self.assertEqual('hello world', text)
 
105
        self.assertEqual(b'hello world', text)
106
106
 
107
107
        tree2 = b.repository.revision_tree(rev2)
108
108
        tree2.lock_read()
109
109
        text = tree2.get_file_text('hello')
110
110
        tree2.unlock()
111
 
        self.assertEqual('version 2', text)
 
111
        self.assertEqual(b'version 2', text)
112
112
 
113
113
    def test_commit_lossy_native(self):
114
114
        """Attempt a lossy commit to a native branch."""
242
242
        tree2.lock_read()
243
243
        self.addCleanup(tree2.unlock)
244
244
        self.assertTrue(tree2.has_filename('hello'))
245
 
        self.assertEqual(tree2.get_file_text('hello'), 'hello')
246
 
        self.assertEqual(tree2.get_file_text('buongia'), 'new text')
 
245
        self.assertEqual(tree2.get_file_text('hello'), b'hello')
 
246
        self.assertEqual(tree2.get_file_text('buongia'), b'new text')
247
247
 
248
248
        tree3 = b.repository.revision_tree(b'test@rev-3')
249
249
        tree3.lock_read()
250
250
        self.addCleanup(tree3.unlock)
251
251
        self.assertFalse(tree3.has_filename('hello'))
252
 
        self.assertEqual(tree3.get_file_text('buongia'), 'new text')
 
252
        self.assertEqual(tree3.get_file_text('buongia'), b'new text')
253
253
 
254
254
    def test_commit_rename(self):
255
255
        """Test commit of a revision where a file is renamed."""
266
266
        tree1 = b.repository.revision_tree(b'test@rev-1')
267
267
        tree1.lock_read()
268
268
        self.addCleanup(tree1.unlock)
269
 
        eq(tree1.id2path(b'hello-id'), 'hello')
270
 
        eq(tree1.get_file_text('hello'), 'contents of hello\n')
 
269
        eq(tree1.id2path(b'hello-id'), b'hello')
 
270
        eq(tree1.get_file_text('hello'), b'contents of hello\n')
271
271
        self.assertFalse(tree1.has_filename('fruity'))
272
272
        self.check_tree_shape(tree1, ['hello'])
273
273
        eq(tree1.get_file_revision('hello'), b'test@rev-1')
276
276
        tree2.lock_read()
277
277
        self.addCleanup(tree2.unlock)
278
278
        eq(tree2.id2path(b'hello-id'), 'fruity')
279
 
        eq(tree2.get_file_text('fruity'), 'contents of hello\n')
 
279
        eq(tree2.get_file_text('fruity'), b'contents of hello\n')
280
280
        self.check_tree_shape(tree2, ['fruity'])
281
281
        eq(tree2.get_file_revision('fruity'), b'test@rev-2')
282
282