/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

  • Committer: Vincent Ladeuil
  • Date: 2010-06-23 16:43:16 UTC
  • mto: (5247.3.43 smart-server-leaks)
  • mto: This revision was merged to the branch mainline in revision 5396.
  • Revision ID: v.ladeuil+lp@free.fr-20100623164316-yffl9m72oh8jy46a
Closing the connection is what pycurl was waiting for.

Show diffs side-by-side

added added

removed removed

Lines of Context:
667
667
        """Fakes handling a single HTTP request, returns a bad status"""
668
668
        ignored = http_server.TestingHTTPRequestHandler.parse_request(self)
669
669
        self.wfile.write("Invalid status line\r\n")
 
670
        # If we don't close the connection pycurl will hang. Since this is a
 
671
        # stress test we don't *have* to respect the protocol, but we don't
 
672
        # have to sabotage it too much either.
 
673
        self.close_connection = True
670
674
        return False
671
675
 
672
676
 
678
682
 
679
683
    _req_handler_class = InvalidStatusRequestHandler
680
684
 
681
 
    def test_http_has(self):
682
 
        # FIXME: that should be fixed now, needs testing -- vila 20100611
683
 
        if self._testing_pycurl() and self._protocol_version == 'HTTP/1.1':
684
 
            raise tests.KnownFailure(
685
 
                'pycurl hangs if the server send back garbage')
686
 
        super(TestInvalidStatusServer, self).test_http_has()
687
 
 
688
 
    def test_http_get(self):
689
 
        if self._testing_pycurl() and self._protocol_version == 'HTTP/1.1':
690
 
            raise tests.KnownFailure(
691
 
                'pycurl hangs if the server send back garbage')
692
 
        super(TestInvalidStatusServer, self).test_http_get()
693
 
 
694
685
 
695
686
class BadProtocolRequestHandler(http_server.TestingHTTPRequestHandler):
696
687
    """Whatever request comes in, returns a bad protocol version"""