libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [12/33] libcloud git commit: Refactor all the unit tests to only have 1 mock connection class and use Connection.conn_class instead of Connection.conn_classes (tuple)
Date Tue, 05 Apr 2016 11:17:03 GMT
http://git-wip-us.apache.org/repos/asf/libcloud/blob/6fd28b6b/libcloud/test/storage/test_backblaze_b2.py
----------------------------------------------------------------------
diff --git a/libcloud/test/storage/test_backblaze_b2.py b/libcloud/test/storage/test_backblaze_b2.py
index eea9f11..728f348 100644
--- a/libcloud/test/storage/test_backblaze_b2.py
+++ b/libcloud/test/storage/test_backblaze_b2.py
@@ -38,8 +38,7 @@ class BackblazeB2StorageDriverTestCase(unittest.TestCase):
 
     def setUp(self):
         self.driver_klass.connectionCls.authCls = MockAuthConn()
-        self.driver_klass.connectionCls.conn_classes = (
-            None, BackblazeB2MockHttp)
+        self.driver_klass.connectionCls.conn_class = BackblazeB2MockHttp
         self.driver_klass.connectionCls.rawResponseCls = \
             BackblazeB2MockRawResponse
         BackblazeB2MockHttp.type = None

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6fd28b6b/libcloud/test/storage/test_base.py
----------------------------------------------------------------------
diff --git a/libcloud/test/storage/test_base.py b/libcloud/test/storage/test_base.py
index 5c234b8..91bbe2f 100644
--- a/libcloud/test/storage/test_base.py
+++ b/libcloud/test/storage/test_base.py
@@ -36,7 +36,7 @@ class BaseStorageTests(unittest.TestCase):
 
     def setUp(self):
         self.send_called = 0
-        StorageDriver.connectionCls.conn_classes = (None, StorageMockHttp)
+        StorageDriver.connectionCls.conn_class = StorageMockHttp
 
         self.driver1 = StorageDriver('username', 'key', host='localhost')
         self.driver1.supports_chunked_encoding = True

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6fd28b6b/libcloud/test/storage/test_cloudfiles.py
----------------------------------------------------------------------
diff --git a/libcloud/test/storage/test_cloudfiles.py b/libcloud/test/storage/test_cloudfiles.py
index 3e911da..dad51b3 100644
--- a/libcloud/test/storage/test_cloudfiles.py
+++ b/libcloud/test/storage/test_cloudfiles.py
@@ -55,8 +55,7 @@ class CloudFilesTests(unittest.TestCase):
     region = 'ord'
 
     def setUp(self):
-        self.driver_klass.connectionCls.conn_classes = (
-            None, CloudFilesMockHttp)
+        self.driver_klass.connectionCls.conn_class = CloudFilesMockHttp
         self.driver_klass.connectionCls.rawResponseCls = \
             CloudFilesMockRawResponse
         CloudFilesMockHttp.type = None

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6fd28b6b/libcloud/test/storage/test_oss.py
----------------------------------------------------------------------
diff --git a/libcloud/test/storage/test_oss.py b/libcloud/test/storage/test_oss.py
index e5eb24f..32a5aca 100644
--- a/libcloud/test/storage/test_oss.py
+++ b/libcloud/test/storage/test_oss.py
@@ -418,8 +418,7 @@ class OSSStorageDriverTestCase(unittest.TestCase):
         return self.driver_type(*self.driver_args)
 
     def setUp(self):
-        self.driver_type.connectionCls.conn_classes = (
-            None, self.mock_response_klass)
+        self.driver_type.connectionCls.conn_class = self.mock_response_klass
         self.driver_type.connectionCls.rawResponseCls = \
             self.mock_raw_response_klass
         self.mock_response_klass.type = None

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6fd28b6b/libcloud/test/storage/test_s3.py
----------------------------------------------------------------------
diff --git a/libcloud/test/storage/test_s3.py b/libcloud/test/storage/test_s3.py
index 2a6e873..95f83de 100644
--- a/libcloud/test/storage/test_s3.py
+++ b/libcloud/test/storage/test_s3.py
@@ -431,8 +431,7 @@ class S3Tests(unittest.TestCase):
         return self.driver_type(*self.driver_args)
 
     def setUp(self):
-        self.driver_type.connectionCls.conn_classes = (None,
-                                                       self.mock_response_klass)
+        self.driver_type.connectionCls.conn_class = self.mock_response_klass
         self.driver_type.connectionCls.rawResponseCls = \
             self.mock_raw_response_klass
         self.mock_response_klass.type = None


Mime
View raw message