~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.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:
152
152
    def test_create_rename(self):
153
153
        """Rename an inventory entry while creating the file"""
154
154
        tree =self.make_branch_and_tree('.')
155
 
        file('name1', 'wb').write('Hello')
 
155
        with file('name1', 'wb') as f: f.write('Hello')
156
156
        tree.add('name1')
157
157
        tree.commit(message="hello")
158
158
        tree.rename_one('name1', 'name2')
165
165
        os.mkdir('dirname1')
166
166
        tree.add('dirname1')
167
167
        filename = pathjoin('dirname1', 'name1')
168
 
        file(filename, 'wb').write('Hello')
 
168
        with file(filename, 'wb') as f: f.write('Hello')
169
169
        tree.add(filename)
170
170
        tree.commit(message="hello")
171
171
        filename2 = pathjoin('dirname1', 'name2')