You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2020/04/03 21:50:05 UTC

[libcloud] 04/04: Don't run additional assertions when running rackspace tests.

This is an automated email from the ASF dual-hosted git repository.

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

commit c963f0881294db1fd4e981094730e0c63677c4d8
Author: Tomaz Muraus <to...@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: