~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

  • Committer: Vincent Ladeuil
  • Date: 2007-05-06 06:59:57 UTC
  • mto: (2495.1.1 bzr.ab.integration)
  • mto: This revision was merged to the branch mainline in revision 2496.
  • Revision ID: v.ladeuil+lp@free.fr-20070506065957-4jdlek9i5at2qb36
Fix bug #112719 by using the right range header.

* HTTPTestUtil.py:
(SingleOnlyRangeRequestHandler): Noisily refuses mutliple range
requests.

* test_http.py:
(TestSingleOnlyRangeRequestServer): Test the retry mechanism when
a server refuses to handle a mutiple range request without
silently replying with a single range or full file response.

* _pycurl.py:
(PyCurlTransport._get_ranged): The header have been built taken
into account the range hint, don't rebuilt it *ignoring* that
hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    ProxyDigestAuthServer,
59
59
    ProxyServer,
60
60
    SingleRangeRequestHandler,
 
61
    SingleOnlyRangeRequestHandler,
61
62
    TestCaseWithRedirectedWebserver,
62
63
    TestCaseWithTwoWebservers,
63
64
    TestCaseWithWebserver,
693
694
    """Tests single range requests accepting server for pycurl implementation"""
694
695
 
695
696
 
 
697
class TestSingleOnlyRangeRequestServer(TestRangeRequestServer):
 
698
    """Test readv against a server which only accept single range requests"""
 
699
 
 
700
    def create_transport_readonly_server(self):
 
701
        return HttpServer(SingleOnlyRangeRequestHandler)
 
702
 
 
703
 
 
704
class TestSingleOnlyRangeRequestServer_urllib(TestSingleOnlyRangeRequestServer,
 
705
                                              TestCaseWithWebserver):
 
706
    """Tests single range requests accepting server for urllib implementation"""
 
707
 
 
708
    _transport = HttpTransport_urllib
 
709
 
 
710
 
 
711
class TestSingleOnlyRangeRequestServer_pycurl(TestWithTransport_pycurl,
 
712
                                              TestSingleOnlyRangeRequestServer,
 
713
                                              TestCaseWithWebserver):
 
714
    """Tests single range requests accepting server for pycurl implementation"""
 
715
 
 
716
 
696
717
class TestNoRangeRequestServer(TestRangeRequestServer):
697
718
    """Test readv against a server which do not accept range requests"""
698
719