libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [libcloud] branch trunk updated: Add additional test cases for region argument.
Date Sun, 04 Oct 2020 15:44:12 GMT
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


The following commit(s) were added to refs/heads/trunk by this push:
     new 0805528  Add additional test cases for region argument.
0805528 is described below

commit 0805528a2bf4054036bd7a85b9b506695611c918
Author: Tomaz Muraus <tomaz@tomaz.me>
AuthorDate: Sun Oct 4 17:43:01 2020 +0200

    Add additional test cases for region argument.
---
 libcloud/test/compute/test_ovh.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/libcloud/test/compute/test_ovh.py b/libcloud/test/compute/test_ovh.py
index fe624bc..f79c2b7 100644
--- a/libcloud/test/compute/test_ovh.py
+++ b/libcloud/test/compute/test_ovh.py
@@ -147,6 +147,21 @@ class OvhTests(unittest.TestCase):
         OvhMockHttp.type = None
         self.driver = OvhNodeDriver(*OVH_PARAMS)
 
+    def test_region_argument(self):
+        driver = OvhNodeDriver(*OVH_PARAMS)
+        self.assertEqual(driver.connection.host, 'api.ovh.com')
+
+        driver = OvhNodeDriver(*OVH_PARAMS, region=None)
+        self.assertEqual(driver.connection.host, 'api.ovh.com')
+
+        driver = OvhNodeDriver(*OVH_PARAMS, region='ca')
+
+        driver = OvhNodeDriver(*OVH_PARAMS, region='eu')
+        self.assertEqual(driver.connection.host, 'eu.api.ovh.com')
+
+        driver = OvhNodeDriver(*OVH_PARAMS, region='ca')
+        self.assertEqual(driver.connection.host, 'ca.api.ovh.com')
+
     def test_list_nodes_invalid_region(self):
         OvhNodeDriver.connectionCls.conn_class = LibcloudConnection
         driver = OvhNodeDriver(*OVH_PARAMS, region='invalid')


Mime
View raw message