Skip to content

Commit 0b45f84

Browse files
committed
Added User.is_authenticated() tests.
1 parent 2debd71 commit 0b45f84

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
status: 304
2+
x-ratelimit-remaining: 58
3+
content-location: https://github.com/api/v2/json/user/show
4+
connection: keep-alive
5+
content-length: 562
6+
server: nginx/0.7.67
7+
x-runtime: 20ms
8+
x-ratelimit-limit: 60
9+
etag: "bc1db0d34b32ae674a174f231a42148a"
10+
cache-control: private, max-age=0, must-revalidate
11+
date: Sun, 22 May 2011 05:05:13 GMT
12+
content-type: application/json; charset=utf-8
13+
14+
{"user":{"plan":{"name":"free","collaborators":0,"space":307200,"private_repos":0},"gravatar_id":"e40de1eb6e8a74cb96b3f07f3994f155","company":null,"name":"James Rowe","created_at":"2009/03/08 14:53:38 -0700","location":"Cambridge, UK","disk_usage":66069,"collaborators":0,"public_repo_count":38,"public_gist_count":64,"blog":"http://jnrowe.github.com/","following_count":5,"id":61381,"owned_private_repo_count":0,"private_gist_count":7,"type":"User","permission":null,"total_private_repo_count":0,"followers_count":6,"login":"JNRowe","email":"jnrowe@gmail.com"}}

tests/test_user.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ def test_followers(self):
4646
def test_following(self):
4747
assert_equals(len(self.client.users.following('defunkt')), 212)
4848

49+
def test_is_authenticated(self):
50+
user = self.client.users.show('defunkt')
51+
assert_true(user.is_authenticated() is False)
52+
user = self.client.users.show('fake_jnrowe_with_auth')
53+
assert_true(user.is_authenticated() is True)
54+
4955

5056
class UserQueries(unittest.TestCase):
5157
"""Test user querying """

0 commit comments

Comments
 (0)