summaryrefslogtreecommitdiff
path: root/src/leap/soledad/tests/u1db_tests
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-05-13 18:12:53 -0300
committerdrebs <drebs@leap.se>2013-05-14 09:12:33 -0300
commit85fa4c91448e36658679cbac982ee00b18f95daa (patch)
tree78d04d36a2dcc5f78c92f39b5c9aa0ef219023bd /src/leap/soledad/tests/u1db_tests
parentd97c607fa8e5e5659e2992b3c8a7c4ab14988fef (diff)
Refactor ssl monkey patching and fix https tests.
Diffstat (limited to 'src/leap/soledad/tests/u1db_tests')
-rw-r--r--src/leap/soledad/tests/u1db_tests/test_https.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/leap/soledad/tests/u1db_tests/test_https.py b/src/leap/soledad/tests/u1db_tests/test_https.py
index 3f8797d8..b4b14722 100644
--- a/src/leap/soledad/tests/u1db_tests/test_https.py
+++ b/src/leap/soledad/tests/u1db_tests/test_https.py
@@ -6,13 +6,13 @@ import sys
from paste import httpserver
-from leap.soledad.tests import u1db_tests as tests
-
from u1db.remote import (
http_client,
http_target,
)
+from leap import soledad
+from leap.soledad.tests import u1db_tests as tests
from leap.soledad.tests.u1db_tests.test_remote_sync_target import (
make_oauth_http_app,
)
@@ -69,6 +69,12 @@ class TestHttpSyncTargetHttpsSupport(tests.TestCaseWithServer):
self.skipTest("Requires pyOpenSSL")
self.cacert_pem = os.path.join(os.path.dirname(__file__),
'testing-certs', 'cacert.pem')
+ # The default u1db http_client class for doing HTTPS only does HTTPS
+ # if the platform is linux. Because of this, soledad replaces that
+ # class with one that will do HTTPS independent of the platform. In
+ # order to maintain the compatibility with u1db default tests, we undo
+ # that replacement here.
+ http_client._VerifiedHTTPSConnection = soledad.old__VerifiedHTTPSConnection
super(TestHttpSyncTargetHttpsSupport, self).setUp()
def getSyncTarget(self, host, path=None):