Rev 5267: Merge sftp-leaks into catch-them-all in file:///home/vila/src/bzr/experimental/leaking-tests/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Fri Jun 11 11:59:59 BST 2010
At file:///home/vila/src/bzr/experimental/leaking-tests/
------------------------------------------------------------
revno: 5267 [merge]
revision-id: v.ladeuil+lp at free.fr-20100611105959-ws1qsl9fw1ko2e18
parent: v.ladeuil+lp at free.fr-20100611071657-uhzhp4j1fp8h737r
parent: v.ladeuil+lp at free.fr-20100611105957-arzvq2xff43slw08
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: catch-them-all
timestamp: Fri 2010-06-11 12:59:59 +0200
message:
Merge sftp-leaks into catch-them-all
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/http_utils.py HTTPTestUtil.py-20050914180604-247d3aafb7a43343
bzrlib/tests/test_bzrdir.py test_bzrdir.py-20060131065654-deba40eef51cf220
bzrlib/tests/test_http.py testhttp.py-20051018020158-b2eef6e867c514d9
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS 2010-06-02 08:43:56 +0000
+++ b/NEWS 2010-06-11 07:45:28 +0000
@@ -20,6 +20,10 @@
Bug Fixes
*********
+* Errors occurring during http(s) test server starts should now be handled
+ cleanly.
+ (Vincent Ladeuil, #392402)
+
* Final fix for 'no help for command' issue. We now show a clean message
when a command has no help, document how to set help more clearly, and
test that all commands available to the test suite have help.
=== modified file 'bzrlib/tests/http_utils.py'
--- a/bzrlib/tests/http_utils.py 2010-02-17 17:11:16 +0000
+++ b/bzrlib/tests/http_utils.py 2010-06-11 10:59:23 +0000
@@ -106,10 +106,20 @@
one. This will currently fail if the primary transport is not
backed by regular disk files.
"""
+
+ # This can be overriden or parametrized by daughter clasess if needed, but
+ # it must exist so that the create_transport_readonly_server() method can
+ # propagate it.
+ _protocol_version = None
+
def setUp(self):
super(TestCaseWithWebserver, self).setUp()
self.transport_readonly_server = http_server.HttpServer
+ def create_transport_readonly_server(self):
+ return self.transport_readonly_server(
+ protocol_version=self._protocol_version)
+
class TestCaseWithTwoWebservers(TestCaseWithWebserver):
"""A support class providing readonly urls on two servers that are http://.
@@ -127,7 +137,8 @@
This is mostly a hook for daughter classes.
"""
- return self.transport_secondary_server()
+ return self.transport_secondary_server(
+ protocol_version=self._protocol_version)
def get_secondary_server(self):
"""Get the server instance for the secondary transport."""
@@ -218,7 +229,8 @@
def create_transport_secondary_server(self):
"""Create the secondary server redirecting to the primary server"""
new = self.get_readonly_server()
- redirecting = HTTPServerRedirecting()
+ redirecting = HTTPServerRedirecting(
+ protocol_version=self._protocol_version)
redirecting.redirect_to(new.host, new.port)
return redirecting
=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py 2010-03-25 14:22:41 +0000
+++ b/bzrlib/tests/test_bzrdir.py 2010-06-11 10:59:23 +0000
@@ -1111,9 +1111,11 @@
"""
def create_transport_readonly_server(self):
+ # We don't set the http protocol version, relying on the default
return http_utils.HTTPServerRedirecting()
def create_transport_secondary_server(self):
+ # We don't set the http protocol version, relying on the default
return http_utils.HTTPServerRedirecting()
def setUp(self):
=== modified file 'bzrlib/tests/test_http.py'
--- a/bzrlib/tests/test_http.py 2010-06-05 10:25:45 +0000
+++ b/bzrlib/tests/test_http.py 2010-06-11 10:59:55 +0000
@@ -90,6 +90,18 @@
_qualified_prefix='http+pycurl',)))
tests.multiply_tests(t_tests, transport_scenarios, result)
+ protocol_scenarios = [
+ ('HTTP/1.0', dict(_protocol_version='HTTP/1.0')),
+ ('HTTP/1.1', dict(_protocol_version='HTTP/1.1')),
+ ]
+
+ # some tests are parametrized by the protocol version only
+ p_tests, remaining_tests = tests.split_suite_by_condition(
+ remaining_tests, tests.condition_isinstance((
+ TestAuthOnRedirected,
+ )))
+ tests.multiply_tests(p_tests, protocol_scenarios, result)
+
# each implementation tested with each HTTP version
tp_tests, remaining_tests = tests.split_suite_by_condition(
remaining_tests, tests.condition_isinstance((
@@ -104,10 +116,6 @@
TestRanges,
TestSpecificRequestHandler,
)))
- protocol_scenarios = [
- ('HTTP/1.0', dict(_protocol_version='HTTP/1.0')),
- ('HTTP/1.1', dict(_protocol_version='HTTP/1.1')),
- ]
tp_scenarios = tests.multiply_scenarios(transport_scenarios,
protocol_scenarios)
tests.multiply_tests(tp_tests, tp_scenarios, result)
@@ -2153,13 +2161,14 @@
_transport = _urllib.HttpTransport_urllib
def create_transport_readonly_server(self):
- return self._auth_server()
+ return self._auth_server(protocol_version=self._protocol_version)
def create_transport_secondary_server(self):
"""Create the secondary server redirecting to the primary server"""
new = self.get_readonly_server()
- redirecting = http_utils.HTTPServerRedirecting()
+ redirecting = http_utils.HTTPServerRedirecting(
+ protocol_version=self._protocol_version)
redirecting.redirect_to(new.host, new.port)
return redirecting
More information about the bazaar-commits
mailing list