~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-04 12:56:11 UTC
  • mfrom: (3842.3.22 call_with_body_stream)
  • Revision ID: pqm@pqm.ubuntu.com-20090204125611-m7kqmwruvndk7yrv
Add client and server APIs for streamed request bodies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
253
253
        self.expecting_body = True
254
254
        return result[1], FakeProtocol(result[2], self)
255
255
 
 
256
    def call_with_body_stream(self, args, stream):
 
257
        # Explicitly consume the stream before checking for an error, because
 
258
        # that's what happens a real medium.
 
259
        stream = list(stream)
 
260
        self._check_call(args[0], args[1:])
 
261
        self._calls.append(('call_with_body_stream', args[0], args[1:], stream))
 
262
        return self._get_next_response()[1]
 
263
 
256
264
 
257
265
class FakeMedium(medium.SmartClientMedium):
258
266