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/02 17:02:51 UTC
[libcloud] 02/02: Add a test case for new method.
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 5685a7b0339d7f697cbcdb8f0e8e0a74c956a26b
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Jul 2 19:01:57 2019 +0200
Add a test case for new method.
---
libcloud/test/compute/test_gce.py | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py
index 6d6ed1c..b79677f 100644
--- a/libcloud/test/compute/test_gce.py
+++ b/libcloud/test/compute/test_gce.py
@@ -449,6 +449,29 @@ class GCENodeDriverTest(GoogleTestCase, TestCaseMixin):
{'name': 'foo',
'port': 4444})
+ def test_ex_instancegroupmanager_set_autohealing_policies(self):
+ kwargs = {'host': 'lchost',
+ 'path': '/lc',
+ 'port': 8000,
+ 'interval': 10,
+ 'timeout': 10,
+ 'unhealthy_threshold': 4,
+ 'healthy_threshold': 3,
+ 'description': 'test healthcheck'}
+ healthcheck_name = 'lchealthcheck'
+ hc = self.driver.ex_create_healthcheck(healthcheck_name, **kwargs)
+
+ ig_name = 'myinstancegroup'
+ ig_zone = 'us-central1-a'
+ manager = self.driver.ex_get_instancegroupmanager(ig_name, ig_zone)
+
+ res = self.driver.ex_instancegroupmanager_set_autohealingpolicies(
+ manager=manager, healthcheck=hc, initialdelaysec=2)
+ self.assertTrue(res)
+
+ res = manager.set_autohealingpolicies(healthcheck=hc, initialdelaysec=2)
+ self.assertTrue(res)
+
def test_ex_create_instancegroupmanager(self):
name = 'myinstancegroup'
zone = 'us-central1-a'
@@ -3567,8 +3590,13 @@ class GCEMockHttp(MockHttp):
def _zones_us_central1_a_instanceGroupManagers_myinstancegroup(
self, method, url, body, headers):
- body = self.fixtures.load(
- 'zones_us-central1-a_instanceGroupManagers_myinstancegroup.json')
+ if method == 'PATCH':
+ # test_ex_instancegroupmanager_set_autohealing_policies
+ body = self.fixtures.load(
+ 'zones_us-central1-a_operations_operation_zones_us-central1-a_instanceGroupManagers_insert_post.json')
+ else:
+ body = self.fixtures.load(
+ 'zones_us-central1-a_instanceGroupManagers_myinstancegroup.json')
return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
def _zones_us_central1_a_instanceGroupManagers_myinstancegroup_shared_network(