Skip to content

Commit 93d25d2

Browse files
committed
Use an authenticated client in follow/unfollow tests.
1 parent dfb2431 commit 93d25d2

3 files changed

Lines changed: 9 additions & 3 deletions

tests/data/github.com,api,v2,json,user,follow,defunkt,eb59ee564b4598ac4a39c71474b539fc renamed to tests/data/github.com,api,v2,json,user,follow,defunkt,access_token=xxx,5670385849f9826634ee63e74bcac43e

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
status: 200
22
x-ratelimit-remaining: 58
3-
content-location: https://github.com/api/v2/json/user/show/mojombo
3+
content-location: https://github.com/api/v2/json/user/show/mojombo?access_token=xxx
44
x-runtime: 23ms
55
content-length: 63
66
server: nginx/0.7.67

tests/data/github.com,api,v2,json,user,unfollow,defunkt,c18f5f6c951d12528f9f3c2af3e1e623 renamed to tests/data/github.com,api,v2,json,user,unfollow,defunkt,access_token=xxx,ec72b726c0324f7a53830c7e38ac6444

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
status: 200
22
x-ratelimit-remaining: 58
3-
content-location: http://github.com/api/v2/json/user/unfollow/defunkt
3+
content-location: http://github.com/api/v2/json/user/unfollow/defunkt?access_token=xxx
44
x-runtime: 23ms
55
content-length: 53
66
server: nginx/0.7.67

tests/test_user.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from nose.tools import (assert_equals, assert_false, assert_true)
66

7+
from github2.client import Github
8+
79
import utils
810

911

@@ -68,7 +70,11 @@ def test_search_by_email(self):
6870
assert_equals(repr(user), '<User: JNRowe>')
6971

7072

71-
class UserMethods(utils.HttpMockTestCase):
73+
class AuthenticatedUserMethods(utils.HttpMockTestCase):
74+
def setUp(self):
75+
super(AuthenticatedUserMethods, self).setUp()
76+
self.client = Github(access_token='xxx')
77+
7278
def test_follow(self):
7379
result = self.client.users.follow('defunkt')
7480
assert_true('defunkt' in result['users'])

0 commit comments

Comments
 (0)