@@ -37,26 +37,9 @@ def test_followers(self):
3737 def test_following (self ):
3838 assert_equals (len (self .client .users .following ('defunkt' )), 212 )
3939
40- def test_is_authenticated (self ):
40+ def test_is_not_authenticated (self ):
4141 user = self .client .users .show ('defunkt' )
4242 assert_true (user .is_authenticated () is False )
43- user = self .client .users .show ('fake_jnrowe_with_auth' )
44- assert_true (user .is_authenticated () is True )
45-
46- def test_private_data (self ):
47- user = self .client .users .show ('fake_jnrowe_with_auth' )
48- assert_equals (user .total_private_repo_count , 0 )
49- assert_equals (user .collaborators , 0 )
50- assert_equals (user .disk_usage , 66069 )
51- assert_equals (user .owned_private_repo_count , 0 )
52- assert_equals (user .private_gist_count , 7 )
53-
54- def test_plan_data (self ):
55- user = self .client .users .show ('fake_jnrowe_with_auth' )
56- assert_equals (user .plan ['name' ], "free" )
57- assert_equals (user .plan ['collaborators' ], 0 )
58- assert_equals (user .plan ['space' ], 307200 )
59- assert_equals (user .plan ['private_repos' ], 0 )
6043
6144
6245class UserQueries (utils .HttpMockTestCase ):
@@ -82,3 +65,28 @@ def test_follow(self):
8265 def test_unfollow (self ):
8366 result = self .client .users .unfollow ('defunkt' )
8467 assert_false ('defunkt' in result ['users' ])
68+
69+ def test_is_authenticated (self ):
70+ user = self .client .users .show ('' )
71+ assert_true (user .is_authenticated () is True )
72+
73+
74+ class AuthenticatedUserProperties (utils .HttpMockTestCase ):
75+ def setUp (self ):
76+ super (AuthenticatedUserProperties , self ).setUp ()
77+ self .client = Github (access_token = 'xxx' )
78+
79+ def test_private_data (self ):
80+ user = self .client .users .show ('' )
81+ assert_equals (user .total_private_repo_count , 0 )
82+ assert_equals (user .collaborators , 0 )
83+ assert_equals (user .disk_usage , 66069 )
84+ assert_equals (user .owned_private_repo_count , 0 )
85+ assert_equals (user .private_gist_count , 7 )
86+
87+ def test_plan_data (self ):
88+ user = self .client .users .show ('' )
89+ assert_equals (user .plan ['name' ], "free" )
90+ assert_equals (user .plan ['collaborators' ], 0 )
91+ assert_equals (user .plan ['space' ], 307200 )
92+ assert_equals (user .plan ['private_repos' ], 0 )
0 commit comments