libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [06/51] [abbrv] libcloud git commit: fix tests for new drivers
Date Mon, 09 Jan 2017 04:52:26 GMT
fix tests for new drivers


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b0cceefc
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b0cceefc
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b0cceefc

Branch: refs/heads/trunk
Commit: b0cceefc43b799763f4a597f4961e40d06181879
Parents: 01636a8
Author: Anthony Shaw <anthonyshaw@apache.org>
Authored: Tue Oct 25 15:45:22 2016 +0100
Committer: Anthony Shaw <anthonyshaw@apache.org>
Committed: Tue Oct 25 15:45:22 2016 +0100

----------------------------------------------------------------------
 libcloud/common/base.py                      | 2 ++
 libcloud/test/compute/test_ec2.py            | 2 +-
 libcloud/test/container/test_rancher.py      | 3 +--
 libcloud/test/dns/test_buddyns.py            | 2 +-
 libcloud/test/dns/test_dnspod.py             | 2 +-
 libcloud/test/dns/test_powerdns.py           | 3 +--
 libcloud/test/storage/test_backblaze_b2.py   | 2 +-
 libcloud/test/storage/test_google_storage.py | 3 +--
 8 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/b0cceefc/libcloud/common/base.py
----------------------------------------------------------------------
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index ee53f6b..56f012c 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -664,6 +664,8 @@ class Connection(object):
         return response
 
     def morph_action_hook(self, action):
+        if not action.startswith("/"):
+            action = "/" + action
         return self.request_path + action
 
     def add_default_params(self, params):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b0cceefc/libcloud/test/compute/test_ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py
index 968929c..5286f65 100644
--- a/libcloud/test/compute/test_ec2.py
+++ b/libcloud/test/compute/test_ec2.py
@@ -1822,7 +1822,7 @@ class FCUMockHttp(EC2MockHttp):
 class OutscaleFCUTests(LibcloudTestCase):
 
     def setUp(self):
-        OutscaleSASNodeDriver.connectionCls.conn_classes = (None, FCUMockHttp)
+        OutscaleSASNodeDriver.connectionCls.conn_class = FCUMockHttp
         EC2MockHttp.use_param = 'Action'
         EC2MockHttp.type = None
         self.driver = OutscaleSASNodeDriver(key=EC2_PARAMS[0],

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b0cceefc/libcloud/test/container/test_rancher.py
----------------------------------------------------------------------
diff --git a/libcloud/test/container/test_rancher.py b/libcloud/test/container/test_rancher.py
index eb23ddf..4793c67 100644
--- a/libcloud/test/container/test_rancher.py
+++ b/libcloud/test/container/test_rancher.py
@@ -29,8 +29,7 @@ from libcloud.test import MockHttp
 class RancherContainerDriverTestCase(unittest.TestCase):
 
     def setUp(self):
-        RancherContainerDriver.connectionCls.conn_classes = (
-            RancherMockHttp, RancherMockHttp)
+        RancherContainerDriver.connectionCls.conn_class = RancherMockHttp
         RancherMockHttp.type = None
         RancherMockHttp.use_param = 'a'
         self.driver = RancherContainerDriver(*CONTAINER_PARAMS_RANCHER)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b0cceefc/libcloud/test/dns/test_buddyns.py
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/test_buddyns.py b/libcloud/test/dns/test_buddyns.py
index 121daed..bf10b78 100644
--- a/libcloud/test/dns/test_buddyns.py
+++ b/libcloud/test/dns/test_buddyns.py
@@ -13,7 +13,7 @@ from libcloud.dns.base import Zone
 class BuddyNSDNSTests(unittest.TestCase):
     def setUp(self):
         BuddyNSMockHttp.type = None
-        BuddyNSDNSDriver.connectionCls.conn_classes = (None, BuddyNSMockHttp)
+        BuddyNSDNSDriver.connectionCls.conn_class = BuddyNSMockHttp
         self.driver = BuddyNSDNSDriver(*DNS_PARAMS_BUDDYNS)
         self.test_zone = Zone(id='test.com', type='master', ttl=None,
                               domain='test.com', extra={}, driver=self)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b0cceefc/libcloud/test/dns/test_dnspod.py
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/test_dnspod.py b/libcloud/test/dns/test_dnspod.py
index c270dc7..8369120 100644
--- a/libcloud/test/dns/test_dnspod.py
+++ b/libcloud/test/dns/test_dnspod.py
@@ -15,7 +15,7 @@ from libcloud.dns.base import Zone, Record
 class DNSPodDNSTests(unittest.TestCase):
     def setUp(self):
         DNSPodMockHttp.type = None
-        DNSPodDNSDriver.connectionCls.conn_classes = (None, DNSPodMockHttp)
+        DNSPodDNSDriver.connectionCls.conn_class = DNSPodMockHttp
         self.driver = DNSPodDNSDriver(*DNS_PARAMS_DNSPOD)
         self.test_zone = Zone(id='11', type='master', ttl=None,
                               domain='test.com', extra={}, driver=self.driver)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b0cceefc/libcloud/test/dns/test_powerdns.py
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/test_powerdns.py b/libcloud/test/dns/test_powerdns.py
index 744676f..f871a4e 100644
--- a/libcloud/test/dns/test_powerdns.py
+++ b/libcloud/test/dns/test_powerdns.py
@@ -30,8 +30,7 @@ from libcloud.test.file_fixtures import DNSFileFixtures
 class PowerDNSTestCase(LibcloudTestCase):
 
     def setUp(self):
-        PowerDNSDriver.connectionCls.conn_classes = (PowerDNSMockHttp,
-                                                     PowerDNSMockHttp)
+        PowerDNSDriver.connectionCls.conn_class = PowerDNSMockHttp
         PowerDNSMockHttp.type = None
         self.driver = PowerDNSDriver('testsecret')
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b0cceefc/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 47dc7ce..d3a9ff4 100644
--- a/libcloud/test/storage/test_backblaze_b2.py
+++ b/libcloud/test/storage/test_backblaze_b2.py
@@ -38,7 +38,7 @@ class BackblazeB2StorageDriverTestCase(unittest.TestCase):
 
     def setUp(self):
         self.driver_klass.connectionCls.authCls = MockAuthConn()
-        self.driver_klass.connectionCls.conn_class = 
+        self.driver_klass.connectionCls.conn_class = \
             BackblazeB2MockHttp
         self.driver_klass.connectionCls.rawResponseCls = \
             BackblazeB2MockRawResponse

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b0cceefc/libcloud/test/storage/test_google_storage.py
----------------------------------------------------------------------
diff --git a/libcloud/test/storage/test_google_storage.py b/libcloud/test/storage/test_google_storage.py
index a2ba5fe..eb892b2 100644
--- a/libcloud/test/storage/test_google_storage.py
+++ b/libcloud/test/storage/test_google_storage.py
@@ -302,8 +302,7 @@ class GoogleStorageTests(S3Tests, GoogleTestCase):
 
     def setUp(self):
         super(GoogleStorageTests, self).setUp()
-        self.driver_type.jsonConnectionCls.conn_classes = (
-            None, GoogleStorageJSONMockHttp)
+        self.driver_type.jsonConnectionCls.conn_class = GoogleStorageJSONMockHttp
 
     def test_billing_not_enabled(self):
         # TODO


Mime
View raw message