Skip to content

Commit f082568

Browse files
author
Gauvain Pocentek
committed
Add feature flags deletion support
1 parent 9c19e06 commit f082568

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

docs/gl_objects/features.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ Create or set a feature::
2424

2525
feature = gl.features.set(feature_name, True)
2626
feature = gl.features.set(feature_name, 30)
27+
28+
Delete a feature::
29+
30+
feature.delete()

gitlab/v4/objects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,11 @@ class DockerfileManager(RetrieveMixin, RESTManager):
462462
_obj_cls = Dockerfile
463463

464464

465-
class Feature(RESTObject):
465+
class Feature(ObjectDeleteMixin, RESTObject):
466466
_id_attr = 'name'
467467

468468

469-
class FeatureManager(ListMixin, RESTManager):
469+
class FeatureManager(ListMixin, DeleteMixin, RESTManager):
470470
_path = '/features/'
471471
_obj_cls = Feature
472472

tools/python_test_v4.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,8 @@
665665
feat = gl.features.set('foo', 30)
666666
assert(feat.name == 'foo')
667667
assert(len(gl.features.list()) == 1)
668+
feat.delete()
669+
assert(len(gl.features.list()) == 0)
668670

669671
# broadcast messages
670672
msg = gl.broadcastmessages.create({'message': 'this is the message'})

0 commit comments

Comments
 (0)