mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Improve test coverage of AuthenticatedUser
This commit is contained in:
@@ -77,3 +77,20 @@ class AuthenticatedUser( Framework.TestCase ):
|
||||
self.assertEqual( self.user.location, oldLocation )
|
||||
self.assertEqual( self.user.hireable, oldHireable )
|
||||
self.assertEqual( self.user.bio, oldBio )
|
||||
|
||||
def testEmails( self ):
|
||||
self.assertEqual( self.user.get_emails(), [ "vincent@vincent-jacques.net", "github.com@vincent-jacques.net" ] )
|
||||
self.user.add_to_emails( "1@foobar.com", "2@foobar.com" )
|
||||
self.assertEqual( self.user.get_emails(), [ "vincent@vincent-jacques.net", "1@foobar.com", "2@foobar.com", "github.com@vincent-jacques.net" ] )
|
||||
self.user.remove_from_emails( "1@foobar.com", "2@foobar.com" )
|
||||
self.assertEqual( self.user.get_emails(), [ "vincent@vincent-jacques.net", "github.com@vincent-jacques.net" ] )
|
||||
|
||||
def testFollowing( self ):
|
||||
nvie = self.g.get_user( "nvie" )
|
||||
self.assertEqual( self.user.get_following()[ 0 ].login, "schacon" )
|
||||
self.assertEqual( self.user.has_in_following( nvie ), True )
|
||||
self.user.remove_from_following( nvie )
|
||||
self.assertEqual( self.user.has_in_following( nvie ), False )
|
||||
self.user.add_to_following( nvie )
|
||||
self.assertEqual( self.user.has_in_following( nvie ), True )
|
||||
self.assertEqual( self.user.get_followers()[ 0 ].login, "jnorthrup" )
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
GET /user/emails {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4934'), ('content-length', '64'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"ea6dacf29569317ccf460b4bb07075e5"'), ('date', 'Sun, 20 May 2012 12:41:39 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
["vincent@vincent-jacques.net","github.com@vincent-jacques.net"]
|
||||
|
||||
POST /user/emails {} ["1@foobar.com", "2@foobar.com"]
|
||||
201
|
||||
[('status', '201 Created'), ('x-ratelimit-remaining', '4933'), ('content-length', '94'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"8efae10ea5e433b0d68201389058e4ee"'), ('date', 'Sun, 20 May 2012 12:41:40 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
["vincent@vincent-jacques.net","1@foobar.com","2@foobar.com","github.com@vincent-jacques.net"]
|
||||
|
||||
GET /user/emails {} null
|
||||
200
|
||||
[('status', '200 OK'), ('content-length', '94'), ('x-ratelimit-remaining', '4932'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"8efae10ea5e433b0d68201389058e4ee"'), ('date', 'Sun, 20 May 2012 12:41:41 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
["vincent@vincent-jacques.net","1@foobar.com","2@foobar.com","github.com@vincent-jacques.net"]
|
||||
|
||||
DELETE /user/emails {} ["1@foobar.com", "2@foobar.com"]
|
||||
204
|
||||
[('status', '204 No Content'), ('x-ratelimit-remaining', '4931'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sun, 20 May 2012 12:41:41 GMT')]
|
||||
|
||||
|
||||
GET /user/emails {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4930'), ('content-length', '64'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"ea6dacf29569317ccf460b4bb07075e5"'), ('date', 'Sun, 20 May 2012 12:41:42 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
["vincent@vincent-jacques.net","github.com@vincent-jacques.net"]
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user