10000 Wrong argument name in Organization.create_team() · CamDavidsonPilon/github3.py@5baf57a · GitHub
[go: up one dir, main page]

Skip to content

Commit 5baf57a

Browse files
Alexander Alexandrovaalexandrov
authored andcommitted
Wrong argument name in Organization.create_team()
Currently 'permissions', according to the API docs[1] should be 'permission'. [1] https://developer.github.com/v3/orgs/teams/#create-team
1 parent 4ddc429 commit 5baf57a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

github3/orgs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,14 @@ def conceal_member(self, login):
303303
return self._boolean(self._delete(url), 204, 404)
304304

305305
@requires_auth
306-
def create_team(self, name, repo_names=[], permissions=''):
306+
def create_team(self, name, repo_names=[], permission=''):
307307
"""Assuming the authenticated user owns this organization,
308308
create and return a new team.
309309
310310
:param str name: (required), name to be given to the team
311311
:param list repo_names: (optional) repositories, e.g.
312312
['github/dotfiles']
313-
:param str permissions: (optional), options:
313+
:param str permission: (optional), options:
314314
315315
- ``pull`` -- (default) members can not push or administer
316316
repositories accessible by this team
@@ -322,7 +322,7 @@ def create_team(self, name, repo_names=[], permissions=''):
322322
:returns: :class:`Team <Team>`
323323
"""
324324
data = {'name': name, 'repo_names': repo_names,
325-
'permissions': permissions}
325+
'permission': permission}
326326
url = self._build_url('teams', base_url=self._api)
327327
json = self._json(self._post(url, data), 201)
328328
return Team(json, self._session) if json else None

tests/test_orgs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,15 @@ def test_create_team(self):
214214
'data': {
215215
'name': 'team',
216216
'repo_names': [],
217-
'permissions': 'push'
217+
'permission': 'push'
218218
}
219219
}
220220

221221
self.assertRaises(github3.GitHubError, self.org.create_team, None)
222222

223223
self.not_called()
224224
self.login()
225-
assert isinstance(self.org.create_team('team', permissions='push'),
225+
assert isinstance(self.org.create_team('team', permission='push'),
226226
github3.orgs.Team)
227227
self.mock_assertions()
228228

0 commit comments

Comments
 (0)
0