Skip to content

Commit e0ca437

Browse files
committed
Doc-strings for tests
- ALso remove the unnecessary pieces of the tests
1 parent df7a6d6 commit e0ca437

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

tests/unit/test_github.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,29 @@ def create_session_mock(self, *args):
2727
return session
2828

2929
def test_revoke_authorization(self):
30-
self.instance.set_client_id('id', 'secret')
30+
"""Test that GitHub#revoke_authorization calls the expected methods.
31+
32+
It should use the session's delete and temporary_basic_auth methods.
33+
"""
3134
self.instance.revoke_authorization('access_token')
3235
self.session.delete.assert_called_once_with(
3336
'https://api.github.com/applications/id/tokens/access_token',
3437
params={'client_id': None, 'client_secret': None}
3538
)
39+
self.session.temporary_basic_auth.assert_called_once_with(
40+
'id', 'secret'
41+
)
3642

3743
def test_revoke_authorizations(self):
38-
self.instance.set_client_id('id', 'secret')
44+
"""Test that GitHub#revoke_authorizations calls the expected methods.
45+
46+
It should use the session's delete and temporary_basic_auth methods.
47+
"""
3948
self.instance.revoke_authorizations()
4049
self.session.delete.assert_called_once_with(
4150
'https://api.github.com/applications/id/tokens',
4251
params={'client_id': None, 'client_secret': None}
4352
)
53+
self.session.temporary_basic_auth.assert_called_once_with(
54+
'id', 'secret'
55+
)

0 commit comments

Comments
 (0)