libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [31/33] libcloud git commit: Remove broken test, fix lua and NSFN tests
Date Tue, 05 Apr 2016 11:17:22 GMT
Remove broken test, fix lua and NSFN tests


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

Branch: refs/heads/requests
Commit: 6c2d57c09dfc5285706d26e0d4860cc870d4af2d
Parents: e1765b9
Author: anthony-shaw <anthony.p.shaw@gmail.com>
Authored: Tue Apr 5 18:02:11 2016 +1000
Committer: anthony-shaw <anthony.p.shaw@gmail.com>
Committed: Tue Apr 5 18:02:11 2016 +1000

----------------------------------------------------------------------
 libcloud/common/base.py           | 10 +++++++---
 libcloud/test/compute/test_gce.py |  7 -------
 libcloud/test/dns/test_luadns.py  |  3 +--
 libcloud/test/dns/test_nfsn.py    |  2 +-
 4 files changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/6c2d57c0/libcloud/common/base.py
----------------------------------------------------------------------
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index 60cfb04..fa1f0ba 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -36,7 +36,7 @@ import requests
 
 import libcloud
 
-from libcloud.utils.py3 import PY25
+from libcloud.utils.py3 import PY25, basestring
 from libcloud.utils.py3 import httplib
 from libcloud.utils.py3 import urlparse
 from libcloud.utils.py3 import urlencode
@@ -151,8 +151,12 @@ class Response(object):
         self.headers = lowercase_keys(dict(response.headers))
         self.error = response.reason
         self.status = response.status_code
-
-        self.body = response.text.strip() if response.text is not None else ''
+        
+        if isinstance(response.text, basestring):
+            self.body = response.text.strip() \
+                if response.text is not None else ''
+        else:
+            self.body = ''
 
         if not self.success():
             raise exception_from_message(code=self.status,

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6c2d57c0/libcloud/test/compute/test_gce.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py
index 2e386aa..e315e2d 100644
--- a/libcloud/test/compute/test_gce.py
+++ b/libcloud/test/compute/test_gce.py
@@ -485,13 +485,6 @@ class GCENodeDriverTest(GoogleTestCase, TestCaseMixin):
         self.assertRaises(GoogleBaseError, self.driver.ex_set_machine_type,
                           node, 'custom-4-61440')
 
-    def test_ex_set_machine_type_invalid(self):
-        # get stopped node, change machine type
-        zone = 'us-central1-a'
-        node = self.driver.ex_get_node('custom-node', zone)
-        self.assertRaises(InvalidRequestError, self.driver.ex_set_machine_type,
-                          node, 'custom-1-61440')
-
     def test_ex_set_machine_type(self):
         # get stopped node, change machine type
         zone = 'us-central1-a'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6c2d57c0/libcloud/test/dns/test_luadns.py
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/test_luadns.py b/libcloud/test/dns/test_luadns.py
index 1bacf98..03ee898 100644
--- a/libcloud/test/dns/test_luadns.py
+++ b/libcloud/test/dns/test_luadns.py
@@ -16,8 +16,7 @@ class LuadnsTests(unittest.TestCase):
 
     def setUp(self):
         LuadnsMockHttp.type = None
-        LuadnsDNSDriver.connectionCls.conn_classes = (
-            None, LuadnsMockHttp)
+        LuadnsDNSDriver.connectionCls.conn_class = LuadnsMockHttp
         self.driver = LuadnsDNSDriver(*DNS_PARAMS_LUADNS)
         self.test_zone = Zone(id='11', type='master', ttl=None,
                               domain='example.com', extra={},

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6c2d57c0/libcloud/test/dns/test_nfsn.py
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/test_nfsn.py b/libcloud/test/dns/test_nfsn.py
index 0a07c2a..b6bfb3a 100644
--- a/libcloud/test/dns/test_nfsn.py
+++ b/libcloud/test/dns/test_nfsn.py
@@ -29,7 +29,7 @@ from libcloud.test.file_fixtures import DNSFileFixtures
 class NFSNTestCase(LibcloudTestCase):
 
     def setUp(self):
-        NFSNDNSDriver.connectionCls.conn_classes = (None, NFSNMockHttp)
+        NFSNDNSDriver.connectionCls.conn_class = NFSNMockHttp
         NFSNMockHttp.type = None
         self.driver = NFSNDNSDriver('testid', 'testsecret')
 


Mime
View raw message