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

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 19:18:40 UTC
  • mto: This revision was merged to the branch mainline in revision 6928.
  • Revision ID: jelmer@jelmer.uk-20180218191840-2wezg20u9ffbfmed
Fix more bees, use with rather than try/finally for some files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
 
197
197
    def make_tree_1(self):
198
198
        mtree = MockTree()
199
 
        mtree.add_dir("a", "grandparent")
200
 
        mtree.add_dir("b", "grandparent/parent")
201
 
        mtree.add_file("c", "grandparent/parent/file", "Hello\n")
202
 
        mtree.add_dir("d", "grandparent/alt_parent")
 
199
        mtree.add_dir(b"a", "grandparent")
 
200
        mtree.add_dir(b"b", "grandparent/parent")
 
201
        mtree.add_file(b"c", "grandparent/parent/file", "Hello\n")
 
202
        mtree.add_dir(b"d", "grandparent/alt_parent")
203
203
        return BundleTree(mtree, ''), mtree
204
204
 
205
205
    def test_renames(self):
843
843
        self.tree1 = self.make_branch_and_tree('b1')
844
844
        self.b1 = self.tree1.branch
845
845
 
846
 
        with open('b1/one', 'wb') as f: f.write('one\n')
 
846
        with open('b1/one', 'wb') as f: f.write(b'one\n')
847
847
        self.tree1.add('one')
848
848
        self.tree1.commit('add file', rev_id=b'a@cset-0-1')
849
 
        with open('b1/one', 'wb') as f: f.write('two\n')
 
849
        with open('b1/one', 'wb') as f: f.write(b'two\n')
850
850
        self.tree1.commit('modify', rev_id=b'a@cset-0-2')
851
 
        with open('b1/one', 'wb') as f: f.write('three\n')
 
851
        with open('b1/one', 'wb') as f: f.write(b'three\n')
852
852
        self.tree1.commit('modify', rev_id=b'a@cset-0-3')
853
853
        bundle_file = BytesIO()
854
854
        rev_ids = write_bundle(self.tree1.branch.repository, 'a@cset-0-3',