summaryrefslogtreecommitdiff
path: root/gitlab/tests/test_gitlab.py
diff options
context:
space:
mode:
authorMax Wittig <max.wittig@siemens.com>2019-10-25 11:13:06 +0200
committerMax Wittig <max.wittig@siemens.com>2019-10-25 11:13:06 +0200
commit32ad66921e408f6553b9d60b6b4833ed3180f549 (patch)
treedc0b664dd13b17f9584971f2c730ad5b0b55ad84 /gitlab/tests/test_gitlab.py
parentac2266b66553cec11740bd5246e23d649606b5ef (diff)
downloadgitlab-32ad66921e408f6553b9d60b6b4833ed3180f549.tar.gz
feat: add users activate, deactivate functionality
These were introduced in GitLab 12.4
Diffstat (limited to 'gitlab/tests/test_gitlab.py')
-rw-r--r--gitlab/tests/test_gitlab.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/gitlab/tests/test_gitlab.py b/gitlab/tests/test_gitlab.py
index c208b31..f9d4cc8 100644
--- a/gitlab/tests/test_gitlab.py
+++ b/gitlab/tests/test_gitlab.py
@@ -695,6 +695,31 @@ class TestGitlab(unittest.TestCase):
deployment.save()
self.assertEqual(deployment.status, "failed")
+ def test_user_activate_deactivate(self):
+ @urlmatch(
+ scheme="http",
+ netloc="localhost",
+ path="/api/v4/users/1/activate",
+ method="post",
+ )
+ def resp_activate(url, request):
+ headers = {"content-type": "application/json"}
+ return response(201, {}, headers, None, 5, request)
+
+ @urlmatch(
+ scheme="http",
+ netloc="localhost",
+ path="/api/v4/users/1/deactivate",
+ method="post",
+ )
+ def resp_deactivate(url, request):
+ headers = {"content-type": "application/json"}
+ return response(201, {}, headers, None, 5, request)
+
+ with HTTMock(resp_activate), HTTMock(resp_deactivate):
+ self.gl.users.get(1, lazy=True).activate()
+ self.gl.users.get(1, lazy=True).deactivate()
+
def test_update_submodule(self):
@urlmatch(
scheme="http", netloc="localhost", path="/api/v4/projects/1$", method="get"