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

Proposed by Vincent Ladeuil on 2009-05-27
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 2009-05-27 Approve on 2009-05-27
Review via email: mp+6819@code.launchpad.net
To post a comment you must log in.
Vincent Ladeuil (vila) wrote :

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

Here is the fix.

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
4384. By Vincent Ladeuil on 2009-05-27

Fixed as per Martin's review.

4385. By Vincent Ladeuil on 2009-05-27

Take more configurations into account.

* bzrlib/tests/test_http.py:
(load_tests): Use the right combination whatever feature is
present (pyrculr OR python2.6 https support).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/test_http.py'
2--- bzrlib/tests/test_http.py 2009-05-27 13:31:41 +0000
3+++ bzrlib/tests/test_http.py 2009-05-27 18:35:24 +0000
4@@ -149,15 +149,18 @@
5 TestActivity,
6 )))
7 activity_scenarios = [
8- ('http', dict(_activity_server=ActivityHTTPServer)),
9- ]
10- act_transport_scenarios = [
11- ('urllib', dict(_transport=_urllib.HttpTransport_urllib,)),
12+ ('urllib,http', dict(_activity_server=ActivityHTTPServer,
13+ _transport=_urllib.HttpTransport_urllib,)),
14 ]
15 if tests.HTTPSServerFeature.available():
16 activity_scenarios.append(
17- ('https', dict(_activity_server=ActivityHTTPSServer)))
18- if pycurl_present:
19+ ('urllib,https', dict(_activity_server=ActivityHTTPSServer,
20+ _transport=_urllib.HttpTransport_urllib,)),)
21+ if pycurl_present:
22+ activity_scenarios.append(
23+ ('pycurl,http', dict(_activity_server=ActivityHTTPServer,
24+ _transport=PyCurlTransport,)),)
25+ if tests.HTTPSServerFeature.available():
26 from bzrlib.tests import (
27 ssl_certs,
28 )
29@@ -172,13 +175,12 @@
30 base, _from_transport)
31 self.cabundle = str(ssl_certs.build_path('ca.crt'))
32
33- act_transport_scenarios.append(
34- ('pycurl', dict(_transport=HTTPS_pycurl_transport,)))
35+ activity_scenarios.append(
36+ ('pycurl,https', dict(_activity_server=ActivityHTTPSServer,
37+ _transport=HTTPS_pycurl_transport,)),)
38
39- tpact_scenarios = tests.multiply_scenarios(
40- tests.multiply_scenarios(act_transport_scenarios,
41- protocol_scenarios),
42- activity_scenarios)
43+ tpact_scenarios = tests.multiply_scenarios(activity_scenarios,
44+ protocol_scenarios)
45 tests.multiply_tests(tpact_tests, tpact_scenarios, result)
46
47 # No parametrization for the remaining tests