summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2018-05-28 08:23:00 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2018-05-28 08:23:00 +0200
commitf082568b9a09f117cd88dd18e7582a620540ff95 (patch)
tree80cce90eed48d9929733c04581ee11334e066d0b
parent9c19e06dbb792308d2fcd4fff1239043981b5f61 (diff)
downloadgitlab-f082568b9a09f117cd88dd18e7582a620540ff95.tar.gz
Add feature flags deletion support
-rw-r--r--docs/gl_objects/features.rst4
-rw-r--r--gitlab/v4/objects.py4
-rw-r--r--tools/python_test_v4.py2
3 files changed, 8 insertions, 2 deletions
diff --git a/docs/gl_objects/features.rst b/docs/gl_objects/features.rst
index 201d072..9f5e685 100644
--- a/docs/gl_objects/features.rst
+++ b/docs/gl_objects/features.rst
@@ -24,3 +24,7 @@ Create or set a feature::
feature = gl.features.set(feature_name, True)
feature = gl.features.set(feature_name, 30)
+
+Delete a feature::
+
+ feature.delete()
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 6c0c84f..45d01a0 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -462,11 +462,11 @@ class DockerfileManager(RetrieveMixin, RESTManager):
_obj_cls = Dockerfile
-class Feature(RESTObject):
+class Feature(ObjectDeleteMixin, RESTObject):
_id_attr = 'name'
-class FeatureManager(ListMixin, RESTManager):
+class FeatureManager(ListMixin, DeleteMixin, RESTManager):
_path = '/features/'
_obj_cls = Feature
diff --git a/tools/python_test_v4.py b/tools/python_test_v4.py
index 37f657a..1527c2e 100644
--- a/tools/python_test_v4.py
+++ b/tools/python_test_v4.py
@@ -665,6 +665,8 @@ assert(ns.kind == 'user')
feat = gl.features.set('foo', 30)
assert(feat.name == 'foo')
assert(len(gl.features.list()) == 1)
+feat.delete()
+assert(len(gl.features.list()) == 0)
# broadcast messages
msg = gl.broadcastmessages.create({'message': 'this is the message'})