diff options
| author | Nejc Habjan <nejc.habjan@siemens.com> | 2020-10-08 01:56:00 +0200 |
|---|---|---|
| committer | Nejc Habjan <nejc.habjan@siemens.com> | 2020-10-08 21:07:53 +0200 |
| commit | 61e43eb186925feede073c7065e5ae868ffbb4ec (patch) | |
| tree | 1c161e148bd6bc696fde0ea076986892bdb9e078 /tools/functional/api/test_clusters.py | |
| parent | 2002098a19f7a9302d373a867ab1a6f87848b6a0 (diff) | |
| download | gitlab-61e43eb186925feede073c7065e5ae868ffbb4ec.tar.gz | |
refactor(tests): split functional tests
Diffstat (limited to 'tools/functional/api/test_clusters.py')
| -rw-r--r-- | tools/functional/api/test_clusters.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tools/functional/api/test_clusters.py b/tools/functional/api/test_clusters.py new file mode 100644 index 0000000..8930aad --- /dev/null +++ b/tools/functional/api/test_clusters.py @@ -0,0 +1,46 @@ +def test_project_clusters(project): + project.clusters.create( + { + "name": "cluster1", + "platform_kubernetes_attributes": { + "api_url": "http://url", + "token": "tokenval", + }, + } + ) + clusters = project.clusters.list() + assert len(clusters) == 1 + + cluster = clusters[0] + cluster.platform_kubernetes_attributes = {"api_url": "http://newurl"} + cluster.save() + + cluster = project.clusters.list()[0] + assert cluster.platform_kubernetes["api_url"] == "http://newurl" + + cluster.delete() + assert len(project.clusters.list()) == 0 + + +def test_group_clusters(group): + group.clusters.create( + { + "name": "cluster1", + "platform_kubernetes_attributes": { + "api_url": "http://url", + "token": "tokenval", + }, + } + ) + clusters = group.clusters.list() + assert len(clusters) == 1 + + cluster = clusters[0] + cluster.platform_kubernetes_attributes = {"api_url": "http://newurl"} + cluster.save() + + cluster = group.clusters.list()[0] + assert cluster.platform_kubernetes["api_url"] == "http://newurl" + + cluster.delete() + assert len(group.clusters.list()) == 0 |
