summaryrefslogtreecommitdiff
path: root/tests/functional/api
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-02-03 23:17:49 +0100
committerJohn Villalovos <john@sodarock.com>2022-02-03 15:43:35 -0800
commit2fea2e64c554fd92d14db77cc5b1e2976b27b609 (patch)
treefe0d097a4473a2650cf4c561bcdfa1f8d2b456fe /tests/functional/api
parente30f39dff5726266222b0f56c94f4ccfe38ba527 (diff)
downloadgitlab-2fea2e64c554fd92d14db77cc5b1e2976b27b609.tar.gz
test(services): add functional tests for services
Diffstat (limited to 'tests/functional/api')
-rw-r--r--tests/functional/api/test_services.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/functional/api/test_services.py b/tests/functional/api/test_services.py
index 100c0c9..51805ef 100644
--- a/tests/functional/api/test_services.py
+++ b/tests/functional/api/test_services.py
@@ -6,6 +6,33 @@ https://docs.gitlab.com/ee/api/integrations.html
import gitlab
-def test_services(project):
+def test_get_service_lazy(project):
service = project.services.get("jira", lazy=True)
assert isinstance(service, gitlab.v4.objects.ProjectService)
+
+
+def test_update_service(project):
+ service_dict = project.services.update(
+ "emails-on-push", {"recipients": "email@example.com"}
+ )
+ assert service_dict["active"]
+
+
+def test_list_services(project, service):
+ services = project.services.list()
+ assert isinstance(services[0], gitlab.v4.objects.ProjectService)
+ assert services[0].active
+
+
+def test_get_service(project, service):
+ service_object = project.services.get(service["slug"])
+ assert isinstance(service_object, gitlab.v4.objects.ProjectService)
+ assert service_object.active
+
+
+def test_delete_service(project, service):
+ service_object = project.services.get(service["slug"])
+ service_object.delete()
+
+ service_object = project.services.get(service["slug"])
+ assert not service_object.active