Skip to content

Commit ec17329

Browse files
committed
teamId is required for calls to team_memberships.list()
The Cisco Spark docs have been updated to correct the documentation bug stating that `teamId` was optional for the list team memberships API. Correct the package, docs and tests to align with the corrected docs.
1 parent f10085b commit ec17329

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

ciscosparkapi/api/teammemberships.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,8 @@ def __init__(self, session):
101101
self._session = session
102102

103103
@generator_container
104-
def list(self, teamId=None, max=None):
105-
"""Lists all team memberships.
106-
107-
By default, lists memberships for teams to which the authenticated user
108-
belongs.
109-
110-
Use teamId to list memberships for a team, by ID.
104+
def list(self, teamId, max=None):
105+
"""List team memberships for a team, by ID.
111106
112107
This method supports Cisco Spark's implementation of RFC5988 Web
113108
Linking to provide pagination support. It returns a generator
@@ -135,11 +130,10 @@ def list(self, teamId=None, max=None):
135130
136131
"""
137132
# Process args
138-
assert teamId is None or isinstance(teamId, basestring)
133+
assert isinstance(teamId, basestring)
139134
assert max is None or isinstance(max, int)
140135
params = {}
141-
if teamId:
142-
params['teamId'] = teamId
136+
params['teamId'] = teamId
143137
if max:
144138
params['max'] = max
145139
# API request - get items

tests/api/test_teammemberships.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,6 @@ def my_team_membership(api, me, team):
7676
if membership.personId == me.id:
7777
return membership
7878

79-
# Cisco Spark API Documentation says that you should be able to retrieve a list
80-
# of all of your team memberships; however, calling the API endpoint without
81-
# specifying a teamId returns an error (and the docs say that a teamId is
82-
# required). #DocumentationBug
83-
# TODO: Report documentation / API bug on retrieving a user's team memberships
84-
# @pytest.fixture(scope="session")
85-
# def authenticated_user_team_memberships(api, team):
86-
# return list(api.team_memberships.list())
87-
8879

8980
@pytest.fixture(scope="session")
9081
def make_me_team_moderator(api, my_team_membership):

0 commit comments

Comments
 (0)