Skip to content

Commit 589b49d

Browse files
Update get_groups() to use documented parameter to filter by name (#586)
1 parent 2794f86 commit 589b49d

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Next Release
1010

1111
- Add metadata query functionality (`#574 <https://github.com/box/box-python-sdk/pull/574>`_)
1212
- Add folder lock functionality (`#581 <https://github.com/box/box-python-sdk/pull/581>`_)
13+
- Update `get_groups()` to use documented parameter to filter by name (`#586 <https://github.com/box/box-python-sdk/pull/586>`_)
1314

1415
2.11.0 (2021-01-11)
1516
++++++++

boxsdk/client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ def get_groups(self, name=None, limit=None, offset=None, fields=None):
622622
url = self.get_url('groups')
623623
additional_params = {}
624624
if name:
625-
additional_params['name'] = name
625+
additional_params['filter_term'] = name
626626
return LimitOffsetBasedObjectCollection(
627627
url=url,
628628
session=self._session,

test/unit/client/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def test_get_groups_return_the_correct_group_objects(
584584
assert group.name == str(expected_id)
585585
# pylint:disable=protected-access
586586
assert group._session == mock_box_session
587-
mock_box_session.get.assert_called_once_with(expected_url, params={'offset': None, 'name': group_name})
587+
mock_box_session.get.assert_called_once_with(expected_url, params={'offset': None, 'filter_term': group_name})
588588

589589

590590
def test_create_group_returns_the_correct_group_object(mock_client, mock_box_session, create_group_response):

0 commit comments

Comments
 (0)