summaryrefslogtreecommitdiff
path: root/tools/python_test_v4.py
diff options
context:
space:
mode:
authoralex lundberg <alex.lundberg@commonbond.co>2019-11-23 13:23:54 -0500
committeralex lundberg <alex.lundberg@commonbond.co>2019-11-24 14:35:25 -0500
commitebd053e7bb695124c8117a95eab0072db185ddf9 (patch)
tree8dd00b5caae3b068b60cbd2c5a04a113f953ebe7 /tools/python_test_v4.py
parentc937338b0119b08b358f97b4716c56777ee7bb80 (diff)
downloadgitlab-ebd053e7bb695124c8117a95eab0072db185ddf9.tar.gz
feat: add project and group clusters
Diffstat (limited to 'tools/python_test_v4.py')
-rw-r--r--tools/python_test_v4.py40
1 files changed, 40 insertions, 0 deletions
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()