8000 Migrated authorization with optional scope to unit/test_github.py · pythonthings/github3.py@679358c · GitHub
[go: up one dir, main page]

Skip to content

Commit 679358c

Browse files
Migrated authorization with optional scope to unit/test_github.py
Per updated documentation, scopes are optional: http://github3py.readthedocs.org/en/latest/github.html#github3.github.GitHub.authorize
1 parent 0632f6a commit 679358c

File tree

2 files changed

+12
-45
lines changed

tests/test_issue_authorize_optional_scope.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

tests/unit/test_github.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ def test_authorization(self):
2323
url_for('authorizations/10'),
2424
)
2525

26+
def test_authorize_without_scope(self):
27+
"""Show an authorization can be created for a user without scope."""
28+
self.instance.authorize('username', 'password')
29+
self.session.temporary_basic_auth.assert_called_once_with(
30+
'username', 'password'
31+
)
32+
self.post_called_with(
33+
url_for('authorizations'),
34+
data={'note': '', 'note_url': '', 'client_id': '',
35+
'client_secret': ''}
36+
)
37+
2638
def test_authorize(self):
2739
"""Show an authorization can be created for a user."""
2840
self.instance.authorize('username', 'password', ['user', 'repo'])

0 commit comments

Comments
 (0)
2940
0