~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/http_utils.py

Merge up bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import urllib2
26
26
import urlparse
27
27
 
28
 
 
29
28
from bzrlib import (
 
29
    errors,
30
30
    tests,
31
31
    transport,
32
32
    )
70
70
        # feeding the bytes in the http request to the smart_protocol_request,
71
71
        # but for now it's simpler to just feed the bytes directly.
72
72
        smart_protocol_request.accept_bytes(self.rfile.read(data_length))
73
 
        assert smart_protocol_request.next_read_size() == 0, (
74
 
            "not finished reading, but all data sent to protocol.")
 
73
        if not (smart_protocol_request.next_read_size() == 0):
 
74
            raise errors.SmartProtocolError(
 
75
                "not finished reading, but all data sent to protocol.")
75
76
        self.send_header("Content-Length", str(len(out_buffer.getvalue())))
76
77
        self.end_headers()
77
78
        self.wfile.write(out_buffer.getvalue())