~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_read_bundle.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-24 10:31:49 UTC
  • mfrom: (4037.1.1 bzr.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090224103149-b9a60tx1qy68jtcj
(vila) Catching-up with review tweaks

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
    def create_test_bundle(self):
73
73
        out, wt = create_bundle_file(self)
74
74
        f = open('test_bundle', 'wb')
75
 
        f.write(out.getvalue())
76
 
        f.close()
 
75
        try:
 
76
            f.write(out.getvalue())
 
77
        finally:
 
78
            f.close()
77
79
        return wt
78
80
 
79
81
    def test_read_bundle_from_url_deprecated(self):
96
98
        out, wt = create_bundle_file(self)
97
99
        if self.get_transport().is_readonly():
98
100
            f = open('test_bundle', 'wb')
99
 
            f.write(out.getvalue())
100
 
            f.close()
 
101
            try:
 
102
                f.write(out.getvalue())
 
103
            finally:
 
104
                f.close()
101
105
        else:
102
106
            self.get_transport().put_file('test_bundle', out)
103
107
            self.log('Put to: %s', self.get_url('test_bundle'))