From ebd053e7bb695124c8117a95eab0072db185ddf9 Mon Sep 17 00:00:00 2001 From: alex lundberg Date: Sat, 23 Nov 2019 13:23:54 -0500 Subject: feat: add project and group clusters --- tools/python_test_v4.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'tools/python_test_v4.py') diff --git a/tools/python_test_v4.py b/tools/python_test_v4.py index bfae8c1..841595d 100644 --- a/tools/python_test_v4.py +++ b/tools/python_test_v4.py @@ -503,6 +503,46 @@ env.stop() env.delete() assert len(admin_project.environments.list()) == 0 +# Project clusters +admin_project.clusters.create( + { + "name": "cluster1", + "platform_kubernetes_attributes": { + "api_url": "http://url", + "token": "tokenval", + }, + } +) +clusters = admin_project.clusters.list() +assert len(clusters) == 1 +cluster = clusters[0] +cluster.platform_kubernetes_attributes = {"api_url": "http://newurl"} +cluster.save() +cluster = admin_project.clusters.list()[0] +assert cluster.platform_kubernetes["api_url"] == "http://newurl" +cluster.delete() +assert len(admin_project.clusters.list()) == 0 + +# Group clusters +group1.clusters.create( + { + "name": "cluster1", + "platform_kubernetes_attributes": { + "api_url": "http://url", + "token": "tokenval", + }, + } +) +clusters = group1.clusters.list() +assert len(clusters) == 1 +cluster = clusters[0] +cluster.platform_kubernetes_attributes = {"api_url": "http://newurl"} +cluster.save() +cluster = group1.clusters.list()[0] +assert cluster.platform_kubernetes["api_url"] == "http://newurl" +cluster.delete() +assert len(group1.clusters.list()) == 0 + # project events admin_project.events.list() -- cgit v1.2.1