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 2017/09/19 21:01:06 UTC
[08/11] libcloud git commit: Add tests for custom storage suffix for
#1110.
Add tests for custom storage suffix for #1110.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/91d14eaa
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/91d14eaa
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/91d14eaa
Branch: refs/heads/trunk
Commit: 91d14eaa0d54432e0b047e291279a4f6123314b1
Parents: ac321e0
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Tue Sep 19 22:41:22 2017 +0200
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Tue Sep 19 22:41:22 2017 +0200
----------------------------------------------------------------------
libcloud/test/compute/test_azure_arm.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/91d14eaa/libcloud/test/compute/test_azure_arm.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_azure_arm.py b/libcloud/test/compute/test_azure_arm.py
index eb2789e..25c3e11 100644
--- a/libcloud/test/compute/test_azure_arm.py
+++ b/libcloud/test/compute/test_azure_arm.py
@@ -43,6 +43,18 @@ class AzureNodeDriverTests(LibcloudTestCase):
self.driver = Azure(self.TENANT_ID, self.SUBSCRIPTION_ID,
self.APPLICATION_ID, self.APPLICATION_PASS)
+ def test_get_image(self):
+ # Default storage suffix
+ image = self.driver.get_image(image_id='http://www.example.com/foo/image_name')
+ self.assertEqual(image.id, 'https://www.blob.core.windows.net/foo/image_name')
+ self.assertEqual(image.name, 'image_name')
+
+ # Custom storage suffix
+ self.driver.connection.storage_suffix = '.core.chinacloudapi.cn'
+ image = self.driver.get_image(image_id='http://www.example.com/foo/image_name')
+ self.assertEqual(image.id, 'https://www.blob.core.chinacloudapi.cn/foo/image_name')
+ self.assertEqual(image.name, 'image_name')
+
def test_locations_returned_successfully(self):
locations = self.driver.list_locations()
self.assertEqual([l.name for l in locations],