Merge lp:~vila/bzr/pycurl-https-activity-test-failures into lp:~bzr/bzr/trunk-old

Proposed by Vincent Ladeuil
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vila/bzr/pycurl-https-activity-test-failures
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 47 lines
To merge this branch: bzr merge lp:~vila/bzr/pycurl-https-activity-test-failures
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+6819@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

Andrew showed me that the combo python2.6/pycurl was failing some tests.

Here is the fix.

Revision history for this message
Martin Pool (mbp) wrote :

43 + tpact_scenarios = tests.multiply_scenarios(act_transport_scenarios,
44 + protocol_scenarios)
45 + tpact_scenarios = tests.multiply_scenarios(tpact_scenarios,
46 + activity_scenarios)

It's cleaner to avoid multiple assignment of similar values to the same variable. Maybe use nested calls?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/tests/test_http.py'
--- bzrlib/tests/test_http.py 2009-05-27 13:31:41 +0000
+++ bzrlib/tests/test_http.py 2009-05-27 18:35:24 +0000
@@ -149,15 +149,18 @@
149 TestActivity,149 TestActivity,
150 )))150 )))
151 activity_scenarios = [151 activity_scenarios = [
152 ('http', dict(_activity_server=ActivityHTTPServer)),152 ('urllib,http', dict(_activity_server=ActivityHTTPServer,
153 ]153 _transport=_urllib.HttpTransport_urllib,)),
154 act_transport_scenarios = [
155 ('urllib', dict(_transport=_urllib.HttpTransport_urllib,)),
156 ]154 ]
157 if tests.HTTPSServerFeature.available():155 if tests.HTTPSServerFeature.available():
158 activity_scenarios.append(156 activity_scenarios.append(
159 ('https', dict(_activity_server=ActivityHTTPSServer)))157 ('urllib,https', dict(_activity_server=ActivityHTTPSServer,
160 if pycurl_present:158 _transport=_urllib.HttpTransport_urllib,)),)
159 if pycurl_present:
160 activity_scenarios.append(
161 ('pycurl,http', dict(_activity_server=ActivityHTTPServer,
162 _transport=PyCurlTransport,)),)
163 if tests.HTTPSServerFeature.available():
161 from bzrlib.tests import (164 from bzrlib.tests import (
162 ssl_certs,165 ssl_certs,
163 )166 )
@@ -172,13 +175,12 @@
172 base, _from_transport)175 base, _from_transport)
173 self.cabundle = str(ssl_certs.build_path('ca.crt'))176 self.cabundle = str(ssl_certs.build_path('ca.crt'))
174177
175 act_transport_scenarios.append(178 activity_scenarios.append(
176 ('pycurl', dict(_transport=HTTPS_pycurl_transport,)))179 ('pycurl,https', dict(_activity_server=ActivityHTTPSServer,
180 _transport=HTTPS_pycurl_transport,)),)
177181
178 tpact_scenarios = tests.multiply_scenarios(182 tpact_scenarios = tests.multiply_scenarios(activity_scenarios,
179 tests.multiply_scenarios(act_transport_scenarios,183 protocol_scenarios)
180 protocol_scenarios),
181 activity_scenarios)
182 tests.multiply_tests(tpact_tests, tpact_scenarios, result)184 tests.multiply_tests(tpact_tests, tpact_scenarios, result)
183185
184 # No parametrization for the remaining tests186 # No parametrization for the remaining tests