Skip to content

Commit fac6308

Browse files
committed
Change how the id parameter is being handled and include the related test
1 parent 6547533 commit fac6308

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

ciscosparkapi/api/people.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,14 @@ def list(self, email=None, displayName=None, orgId=None, id=None, max=None, **qu
177177
params = {}
178178
if id:
179179
params["id"] = id
180-
else:
181-
if email:
180+
elif email:
182181
params['email'] = email
183-
elif displayName:
184-
params['displayName'] = displayName
185-
if orgId:
186-
params["orgId"] = orgId
187-
if max:
188-
params['max'] = max
182+
elif displayName:
183+
params['displayName'] = displayName
184+
if orgId:
185+
params["orgId"] = orgId
186+
if max:
187+
params['max'] = max
189188
# Process query_param keyword arguments
190189
if query_params:
191190
params.update(query_params)

tests/api/test_people.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ def test_list_people_by_display_name(self, api, test_people):
180180
assert len(list_of_people) >= 1
181181
assert are_valid_people(list_of_people)
182182

183+
def test_list_people_by_id(self, api, test_people):
184+
id = test_people["not_a_member"].id
185+
list_of_people = list_people(api, id=id)
186+
assert len(list_of_people) >= 1
187+
assert are_valid_people(list_of_people)
188+
183189
def test_list_people_with_paging(self, api, test_people,
184190
additional_group_room_memberships):
185191
page_size = 1

0 commit comments

Comments
 (0)