~bzr-pqm/bzr/bzr.dev

Viewing all changes in revision 5247.3.29.

  • Committer: Vincent Ladeuil
  • Date: 2010-06-11 16:31:34 UTC
  • mto: (5247.4.12 sftp-leaks)
  • mto: This revision was merged to the branch mainline in revision 5396.
  • Revision ID: v.ladeuil+lp@free.fr-20100611163134-6z4oydq7kw401vdl
Fix a bunch of tests that were building transport objects explicitely instead of relying on self.get_transport() leading to many wrong http implementation objects being tested.

* bzrlib/tests/test_http.py:
(load_tests): Rename _qualified_prefix into _url_protocol to
ensure it's taken into account for all created http servers (and
from there that we create the right kind of transport). Relying on
_transport for that proved to be unreliable (mixed
self.transport(), self.get_transport(),
self.get_readonly_transport, etc calls) and give the wrong
transport objects to the tests.
(TestSpecificRequestHandler.create_transport_readonly_server):
Propagate url_protocol.
(TestHTTPConnections, TestWallServer, TestBadStatusServer)
(TestBadProtocolServer, TestForbiddenServer)
(TestRangeRequestServer, TestLimitedRangeRequestServer)
(TestProxyHttpServer, TestRanges, TestHTTPRedirections)
(TestHTTPSilentRedirections, TestDoCatchRedirections, TestAuth)
(TestProxyAuth, SmartHTTPTunnellingTest, TestAuthOnRedirected):
Stop using self._transport.

* bzrlib/tests/http_utils.py:
(TestCaseWithWebserver): Define and propagate url_protocol like we
did for the http protocol version.
(TestCaseWithTwoWebservers.create_transport_secondary_server):
Propagate url_protocol.
(TestCaseWithTwoWebservers.get_secondary_url)
(TestCaseWithTwoWebservers.get_secondary_transport): Add missing
helpers.
(TestCaseWithRedirectedWebserver.create_transport_secondary_server):
Propagate url_protocol.
(TestCaseWithRedirectedWebserver.get_old_url)
(TestCaseWithRedirectedWebserver.get_old_transport)
(TestCaseWithRedirectedWebserver.get_new_url)
(TestCaseWithRedirectedWebserver.get_new_transport): Add missing
helpers

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: