libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [libcloud] 17/21: Don't run additional assertions when running rackspace tests.
Date Sat, 04 Apr 2020 20:45:19 GMT
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch 2.8.x
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit bf9e088273693550fecef2275b1b3ed826d47a02
Author: Tomaz Muraus <tomaz@tomaz.me>
AuthorDate: Fri Apr 3 23:48:48 2020 +0200

    Don't run additional assertions when running rackspace tests.
---
 libcloud/test/compute/test_openstack.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index a7dd0ec..fb48e56 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -1053,7 +1053,6 @@ class OpenStack_1_1_Tests(unittest.TestCase, TestCaseMixin):
         volume = self.driver.ex_get_volume(
             'cd76a3a1-c4ce-40f6-9b9f-07a61508938d')
 
-        OpenStack_1_1_MockHttp.type = 'DEVICE_AUTO'
         OpenStack_2_0_MockHttp.type = 'DEVICE_AUTO'
 
         self.assertEqual(
@@ -2345,8 +2344,10 @@ class OpenStack_1_1_MockHttp(MockHttp, unittest.TestCase):
     def _v2_1337_servers_12065_os_volume_attachments_DEVICE_AUTO(self, method, url, body,
headers):
         # test_attach_volume_device_auto
         if method == "POST":
-            body = json.loads(body)
-            self.assertEqual(body['volumeAttachment']['device'], None)
+            if 'rackspace' not in self.__class__.__name__.lower():
+                body = json.loads(body)
+                self.assertEqual(body['volumeAttachment']['device'], None)
+
             return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT])
         else:
             raise NotImplementedError()
@@ -2461,8 +2462,10 @@ class OpenStack_1_1_MockHttp(MockHttp, unittest.TestCase):
 
     def _v1_1_slug_servers_12065_os_volume_attachments(self, method, url, body, headers):
         if method == "POST":
-            body = json.loads(body)
-            self.assertEqual(body['volumeAttachment']['device'], '/dev/sdb')
+            if 'rackspace' not in self.__class__.__name__.lower():
+                body = json.loads(body)
+                self.assertEqual(body['volumeAttachment']['device'], '/dev/sdb')
+
             body = self.fixtures.load(
                 '_servers_12065_os_volume_attachments.json')
         else:


Mime
View raw message