~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: Vincent Ladeuil
  • Date: 2007-12-04 08:26:24 UTC
  • mto: (2929.3.16 https) (3097.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 3099.
  • Revision ID: v.ladeuil+lp@free.fr-20071204082624-14qyieeefm13zm7b
Jam's review feedback.

* bzrlib/transport/http/response.py:
(RangeFile.set_range_from_header): Catch ValueError only.

* bzrlib/transport/http/__init__.py:
(HttpTransportBase._readv, HttpTransportBase._coalesce_readv):
'file' is a builtin use rfile instead.

* bzrlib/tests/test_transport_implementations.py:
(TransportTests.test_get): Use izip.

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
        # Use itertools.imap() instead of use zip() or map(), since they fully
191
191
        # evaluate their inputs, the transport requests should be issued and
192
192
        # handled sequentially (we don't want to force transport to buffer).
193
 
        for content, f in itertools.imap(None, contents, content_f):
 
193
        for content, f in itertools.izip(contents, content_f):
194
194
            self.assertEqual(content, f.read())
195
195
 
196
196
        content_f = t.get_multi(iter(files))
197
197
        # Use itertools.imap() for the same reason
198
 
        for content, f in itertools.imap(None, contents, content_f):
 
198
        for content, f in itertools.izip(contents, content_f):
199
199
            self.assertEqual(content, f.read())
200
200
 
201
201
        self.assertRaises(NoSuchFile, t.get, 'c')