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 2019/07/19 21:04:45 UTC

[libcloud] 01/08: added test case and return val

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 620388176f06e432b8e61584d5074bd3e60c25b4
Author: Reza Shahriari <re...@Rezas-MacBook-Pro.local>
AuthorDate: Fri Jul 19 11:06:51 2019 -0400

    added test case and return val
---
 libcloud/compute/drivers/azure_arm.py   | 4 +++-
 libcloud/test/compute/test_azure_arm.py | 5 +++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libcloud/compute/drivers/azure_arm.py b/libcloud/compute/drivers/azure_arm.py
index d3902c6..fa685e8 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -1874,7 +1874,7 @@ class AzureNodeDriver(NodeDriver):
         :type public_ip: `.AzureIPAddress`
         """
         resource = public_ip.id
-        self.connection.request(
+        r = self.connection.request(
             resource,
             method='DELETE',
             params={
@@ -1882,6 +1882,8 @@ class AzureNodeDriver(NodeDriver):
             },
         )
 
+        return r.object
+
     def ex_create_network_interface(self, name, subnet, resource_group,
                                     location=None, public_ip=None):
         """
diff --git a/libcloud/test/compute/test_azure_arm.py b/libcloud/test/compute/test_azure_arm.py
index 285d752..cd0a87b 100644
--- a/libcloud/test/compute/test_azure_arm.py
+++ b/libcloud/test/compute/test_azure_arm.py
@@ -564,6 +564,11 @@ class AzureNodeDriverTests(LibcloudTestCase):
         snapshot = self.driver.list_snapshots()[0]
         res_value = snapshot.destroy()
         self.assertTrue(res_value)
+    
+    def test_delete_public_ip(self):
+        public_ip = self.driver.ex_create_public_ip(name='test_public_ip', resource_group='111111')
+        res_value = self.driver.ex_delete_public_ip(public_ip)
+        self.assertTrue(res_value)
 
     def test_update_network_profile(self):
         nics = self.driver.ex_list_nics()