Skip to content

Commit b766203

Browse files
nateatkinsmax-wittig
nateatkins
authored andcommitted
fix(cli): fix update value for key not working
1 parent 8f1ed93 commit b766203

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

gitlab/mixins.py

+2
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ def create(self, data, **kwargs):
208208
class UpdateMixin(object):
209209
def _check_missing_update_attrs(self, data):
210210
required, optional = self.get_update_attrs()
211+
# Remove the id field from the required list as it was previously moved to the http path.
212+
required = tuple(filter(lambda k: k != self._obj_cls._id_attr, required))
211213
missing = []
212214
for attr in required:
213215
if attr not in data:

tools/cli_test_v4.sh

100644100755
+25
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,31 @@ testcase "merge request validation" '
8989
--iid "$MR_ID" >/dev/null 2>&1
9090
'
9191

92+
# Test project variables
93+
testcase "create project variable" '
94+
OUTPUT=$(GITLAB -v project-variable create --project-id $PROJECT_ID \
95+
--key junk --value car)
96+
'
97+
98+
testcase "get project variable" '
99+
OUTPUT=$(GITLAB -v project-variable get --project-id $PROJECT_ID \
100+
--key junk)
101+
'
102+
103+
testcase "update project variable" '
104+
OUTPUT=$(GITLAB -v project-variable update --project-id $PROJECT_ID \
105+
--key junk --value bus)
106+
'
107+
108+
testcase "list project variable" '
109+
OUTPUT=$(GITLAB -v project-variable list --project-id $PROJECT_ID)
110+
'
111+
112+
testcase "delete project variable" '
113+
OUTPUT=$(GITLAB -v project-variable delete --project-id $PROJECT_ID \
114+
--key junk)
115+
'
116+
92117
testcase "branch deletion" '
93118
GITLAB project-branch delete --project-id "$PROJECT_ID" \
94119
--name branch1 >/dev/null 2>&1

0 commit comments

Comments
 (0)