summaryrefslogtreecommitdiff
path: root/tests/functional/api/test_groups.py
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2022-02-01 09:53:21 -0800
committerJohn L. Villalovos <john@sodarock.com>2022-02-01 09:53:21 -0800
commit0841a2a686c6808e2f3f90960e529b26c26b268f (patch)
tree8d979a04acc1ff327b6cb58f96878290d5e27f3b /tests/functional/api/test_groups.py
parent7646360d6b622b1008917116dc4f64ced32f4057 (diff)
downloadgitlab-0841a2a686c6808e2f3f90960e529b26c26b268f.tar.gz
fix: remove custom `delete` method for labels
The usage of deleting was incorrect according to the current API. Remove custom `delete()` method as not needed. Add tests to show it works with labels needing to be encoded. Also enable the test_group_labels() test function. Previously it was disabled. Add ability to do a `get()` for group labels. Closes: #1867
Diffstat (limited to 'tests/functional/api/test_groups.py')
-rw-r--r--tests/functional/api/test_groups.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/functional/api/test_groups.py b/tests/functional/api/test_groups.py
index b613055..6525a5b 100644
--- a/tests/functional/api/test_groups.py
+++ b/tests/functional/api/test_groups.py
@@ -104,7 +104,6 @@ def test_groups(gl):
group2.members.delete(gl.user.id)
-@pytest.mark.skip(reason="Commented out in legacy test")
def test_group_labels(group):
group.labels.create({"name": "foo", "description": "bar", "color": "#112233"})
label = group.labels.get("foo")
@@ -116,6 +115,12 @@ def test_group_labels(group):
assert label.description == "baz"
assert len(group.labels.list()) == 1
+ label.new_name = "Label:that requires:encoding"
+ label.save()
+ assert label.name == "Label:that requires:encoding"
+ label = group.labels.get("Label:that requires:encoding")
+ assert label.name == "Label:that requires:encoding"
+
label.delete()
assert len(group.labels.list()) == 0