Rev 6256: Fix hanging tests by providing the expected ssl.ca_certs via a config file. in file:///home/vila/src/bzr/reviews/urllib-verifies-ssl-certs/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Jan 19 15:27:33 UTC 2012
At file:///home/vila/src/bzr/reviews/urllib-verifies-ssl-certs/
------------------------------------------------------------
revno: 6256
revision-id: v.ladeuil+lp at free.fr-20120119152732-snhmsofdpz4q50js
parent: jelmer at samba.org-20120107000324-tha9oil7r0s63on5
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: urllib-verifies-ssl-certs
timestamp: Thu 2012-01-19 16:27:32 +0100
message:
Fix hanging tests by providing the expected ssl.ca_certs via a config file.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_http.py'
--- a/bzrlib/tests/test_http.py 2011-11-04 02:45:03 +0000
+++ b/bzrlib/tests/test_http.py 2012-01-19 15:27:32 +0000
@@ -46,6 +46,7 @@
features,
http_server,
http_utils,
+ ssl_certs,
test_server,
)
from bzrlib.tests.scenarios import (
@@ -2126,6 +2127,11 @@
_activities[direction] = count
self.activities = _activities
+ store = config.GlobalStore()
+ content = ('[DEFAULT]\nssl.ca_certs=%s\n'
+ % ssl_certs.build_path('ca.crt'))
+ store._load_from_string(content.encode('utf-8'))
+ store.save()
# We override at class level because constructors may propagate the
# bound method and render instance overriding ineffective (an
# alternative would be to define a specific ui factory instead...)
@@ -2252,7 +2258,7 @@
self.assertActivitiesMatch()
-class TestActivity(tests.TestCase, TestActivityMixin):
+class TestActivity(tests.TestCaseInTempDir, TestActivityMixin):
scenarios = multiply_scenarios(
vary_by_http_activity(),
@@ -2263,7 +2269,7 @@
TestActivityMixin.setUp(self)
-class TestNoReportActivity(tests.TestCase, TestActivityMixin):
+class TestNoReportActivity(tests.TestCaseInTempDir, TestActivityMixin):
# Unlike TestActivity, we are really testing ReportingFileSocket and
# ReportingSocket, so we don't need all the parametrization. Since
More information about the bazaar-commits
mailing list