Skip to content

Commit

Permalink
Merge pull request #833 from python-gitlab/project-variable-update
Browse files Browse the repository at this point in the history
fix(cli): fix update value for key not working
  • Loading branch information
max-wittig committed Jul 21, 2019
2 parents 8306ef2 + b766203 commit 6c673c6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gitlab/mixins.py
Expand Up @@ -208,6 +208,8 @@ def create(self, data, **kwargs):
class UpdateMixin(object):
def _check_missing_update_attrs(self, data):
required, optional = self.get_update_attrs()
# Remove the id field from the required list as it was previously moved to the http path.
required = tuple(filter(lambda k: k != self._obj_cls._id_attr, required))
missing = []
for attr in required:
if attr not in data:
Expand Down
25 changes: 25 additions & 0 deletions tools/cli_test_v4.sh 100644 → 100755
Expand Up @@ -89,6 +89,31 @@ testcase "merge request validation" '
--iid "$MR_ID" >/dev/null 2>&1
'

# Test project variables
testcase "create project variable" '
OUTPUT=$(GITLAB -v project-variable create --project-id $PROJECT_ID \
--key junk --value car)
'

testcase "get project variable" '
OUTPUT=$(GITLAB -v project-variable get --project-id $PROJECT_ID \
--key junk)
'

testcase "update project variable" '
OUTPUT=$(GITLAB -v project-variable update --project-id $PROJECT_ID \
--key junk --value bus)
'

testcase "list project variable" '
OUTPUT=$(GITLAB -v project-variable list --project-id $PROJECT_ID)
'

testcase "delete project variable" '
OUTPUT=$(GITLAB -v project-variable delete --project-id $PROJECT_ID \
--key junk)
'

testcase "branch deletion" '
GITLAB project-branch delete --project-id "$PROJECT_ID" \
--name branch1 >/dev/null 2>&1
Expand Down

0 comments on commit 6c673c6

Please sign in to comment.