~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bundle.py

  • Committer: Wouter van Heyst
  • Date: 2012-01-25 21:13:15 UTC
  • mto: (6437.3.27 2.5)
  • mto: This revision was merged to the branch mainline in revision 6451.
  • Revision ID: larstiq@larstiq.dyndns.org-20120125211315-ch74doua37bqet0i
mechanically replace file().write() pattern with a with-keyword version

Show diffs side-by-side

added added

removed removed

Lines of Context:
649
649
        bundle = self.get_valid_bundle('null:', 'a@cset-0-4')
650
650
 
651
651
        # Modified files
652
 
        open('b1/sub/dir/WithCaps.txt', 'ab').write('\nAdding some text\n')
653
 
        open('b1/sub/dir/ pre space', 'ab').write(
 
652
        with open('b1/sub/dir/WithCaps.txt', 'ab') as f: f.write('\nAdding some text\n')
 
653
        with open('b1/sub/dir/ pre space', 'ab') as f: f.write(
654
654
             '\r\nAdding some\r\nDOS format lines\r\n')
655
 
        open('b1/sub/dir/nolastnewline.txt', 'ab').write('\n')
 
655
        with open('b1/sub/dir/nolastnewline.txt', 'ab') as f: f.write('\n')
656
656
        self.tree1.rename_one('sub/dir/ pre space',
657
657
                              'sub/ start space')
658
658
        self.tree1.commit('Modified files', rev_id='a@cset-0-5')
897
897
        bundle = self.get_valid_bundle('null:', 'white-1')
898
898
 
899
899
        # Modified
900
 
        open('b1/trailing space ', 'ab').write('add some text\n')
 
900
        with open('b1/trailing space ', 'ab') as f: f.write('add some text\n')
901
901
        self.tree1.commit('add text', rev_id='white-2')
902
902
 
903
903
        bundle = self.get_valid_bundle('white-1', 'white-2')