diff options
author | John L. Villalovos <john@sodarock.com> | 2022-07-27 16:08:25 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2022-07-27 16:08:25 -0700 |
commit | 1af44ce8761e6ee8a9467a3e192f6c4d19e5cefe (patch) | |
tree | da3116aa356818cb2a865b047de9ef160bbfffa7 /tests/functional/api/test_groups.py | |
parent | 194ee0100c2868c1a9afb161c15f3145efb01c7c (diff) | |
download | gitlab-1af44ce8761e6ee8a9467a3e192f6c4d19e5cefe.tar.gz |
fix: use the [] after key names for array variables in `params`
1. If a value is of type ArrayAttribute then append '[]' to the name
of the value for query parameters (`params`).
This is step 3 in a series of steps of our goal to add full
support for the GitLab API data types[1]:
* array
* hash
* array of hashes
Step one was: commit 5127b1594c00c7364e9af15e42d2e2f2d909449b
Step two was: commit a57334f1930752c70ea15847a39324fa94042460
Fixes: #1698
[1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types
Diffstat (limited to 'tests/functional/api/test_groups.py')
-rw-r--r-- | tests/functional/api/test_groups.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/functional/api/test_groups.py b/tests/functional/api/test_groups.py index 88e5a36..7688273 100644 --- a/tests/functional/api/test_groups.py +++ b/tests/functional/api/test_groups.py @@ -99,6 +99,11 @@ def test_groups(gl): assert len(group1.members.list()) == 3 assert len(group2.members.list()) == 2 + # Test `user_ids` array + result = group1.members.list(user_ids=[user.id, 99999]) + assert len(result) == 1 + assert result[0].id == user.id + group1.members.delete(user.id) assert user not in group1.members.list() assert group1.members_all.list() |