Remove some easy or obsolete 'todo's

See issues #2 #4 #18 #35 #36 #37
This commit is contained in:
Vincent Jacques
2012-05-29 19:49:50 +02:00
parent 5979802348
commit e5d57323b6
18 changed files with 31 additions and 52 deletions
@@ -4,10 +4,6 @@ import os.path
import json
import itertools
### @todo Mandatory/optional attributes
### @todo Remove '_identity' from the normalized json description
### @todo Use of method arguments as input data or url parameters in request
def mergeDict( base, *additions ):
r = dict( base )
for addition in additions:
@@ -88,7 +84,7 @@ class Function:
def __init__( self, desc, *additionalDescs ):
desc = mergeDict( desc, *additionalDescs )
checkKeys( desc, [ "name", "type", "group" ], [ "url", "isMutation", "mandatoryParameters", "optionalParameters", "variadicParameter", "parameter", "request" ] ) # @todo Move request to mandatoryKeys
checkKeys( desc, [ "name", "type", "group", "request" ], [ "url", "isMutation", "mandatoryParameters", "optionalParameters", "variadicParameter", "parameter", "request" ] )
self.name = desc[ "name" ]
self.type = Type( desc[ "type" ] )
+5 -6
View File
@@ -17,8 +17,7 @@ class Github( object ):
def get_user( self, login = None ):
if login is None:
attributes = {
"url": "https://api.github.com/user", # @todo Erf, this url is replaced by /users/login when __complete is called...
# "login": self.__login # @todo ?
"url": "https://api.github.com/user",
}
return AuthenticatedUser.AuthenticatedUser( self.__requester, attributes, completion = LazyCompletion )
else:
@@ -30,15 +29,15 @@ class Github( object ):
def get_organization( self, login ):
attributes = {
"url": "https://api.github.com/orgs/" + login,
"login": login,
"url": "https://api.github.com/orgs/" + login,
"login": login,
}
return Organization.Organization( self.__requester, attributes, completion = ImmediateCompletion )
def get_gist( self, id ):
attributes = {
"url": "https://api.github.com/gists/" + str( id ),
"id": id,
"url": "https://api.github.com/gists/" + str( id ),
"id": id,
}
return Gist.Gist( self.__requester, attributes, completion = ImmediateCompletion )
+2 -2
View File
@@ -96,12 +96,12 @@ class AuthenticatedUser( Framework.TestCase ):
def testCreateGist( self ):
gist = self.user.create_gist( True, { "foobar.txt": { "content": "File created by PyGithub" } }, "Gist created by PyGithub" )
self.assertEqual( gist.description, "Gist created by PyGithub" )
self.assertEqual( gist.files, {u'foobar.txt': {u'raw_url': u'https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt', u'language': u'Text', u'filename': u'foobar.txt', u'content': u'File created by PyGithub', u'type': u'text/plain', u'size': 24}} ) ### @todo
self.assertEqual( gist.files, {u'foobar.txt': {u'raw_url': u'https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt', u'language': u'Text', u'filename': u'foobar.txt', u'content': u'File created by PyGithub', u'type': u'text/plain', u'size': 24}} )
def testCreateGistWithoutDescription( self ):
gist = self.user.create_gist( True, { "foobar.txt": { "content": "File created by PyGithub" } } )
self.assertEqual( gist.description, None )
self.assertEqual( gist.files, {u'foobar.txt': {u'raw_url': u'https://gist.github.com/raw/2793179/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt', u'language': u'Text', u'filename': u'foobar.txt', u'content': u'File created by PyGithub', u'type': u'text/plain', u'size': 24}} ) ### @todo
self.assertEqual( gist.files, {u'foobar.txt': {u'raw_url': u'https://gist.github.com/raw/2793179/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt', u'language': u'Text', u'filename': u'foobar.txt', u'content': u'File created by PyGithub', u'type': u'text/plain', u'size': 24}} )
def testCreateKey( self ):
key = self.user.create_key( "Key added through PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE" )
+1 -1
View File
@@ -6,7 +6,7 @@ class Authorization( Framework.TestCase ):
self.authorization = self.g.get_user().get_authorization( 372259 )
def testAttributes( self ):
self.assertEqual( self.authorization.app, {u'url': u'http://developer.github.com/v3/oauth/#oauth-authorizations-api', u'name': u'GitHub API'} ) ### @todo
self.assertEqual( self.authorization.app, {u'url': u'http://developer.github.com/v3/oauth/#oauth-authorizations-api', u'name': u'GitHub API'} )
self.assertEqual( self.authorization.created_at, "2012-05-22T18:03:17Z" )
self.assertEqual( self.authorization.id, 372259 )
self.assertEqual( self.authorization.note, None )
+1 -1
View File
@@ -10,7 +10,7 @@ class Event( Framework.TestCase ):
self.assertEqual( self.event.created_at, "2012-05-26T10:01:39Z" )
self.assertEqual( self.event.id, "1556114751" )
self.assertEqual( self.event.org, None )
self.assertEqual( self.event.payload, {u'commits': [{u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'sha': u'5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'message': u'Implement the three authentication schemes', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/cb0313157bf904f2d364377d35d9397b269547a5', u'sha': u'cb0313157bf904f2d364377d35d9397b269547a5', u'message': u"Merge branch 'topic/Authentication' into develop", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'sha': u'0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'message': u'Publish version 0.7', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'sha': u'ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'message': u"Merge branch 'develop'", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/3a3bf4763192ee1234eb0557628133e06f3dfc76', u'sha': u'3a3bf4763192ee1234eb0557628133e06f3dfc76', u'message': u"Merge branch 'master' into topic/RewriteWithGeneratedCode\n\nConflicts:\n\tgithub/Github.py\n\tgithub/Requester.py", u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/608f17794664f61693a3dc05e6056fea8fbef0ff', u'sha': u'608f17794664f61693a3dc05e6056fea8fbef0ff', u'message': u'Restore some form of Authorization header in replay data', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'sha': u'2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'message': u'Allow test without pre-set-up Github', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5b97389988b6fe43e15a079702f6f1671257fb28', u'sha': u'5b97389988b6fe43e15a079702f6f1671257fb28', u'message': u'Test three authentication schemes', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/12747613c5ec00deccf296b8619ad507f7050475', u'sha': u'12747613c5ec00deccf296b8619ad507f7050475', u'message': u'Test Issue.getComments', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2982fa96c5ca75abe717d974d83f9135d664232e', u'sha': u'2982fa96c5ca75abe717d974d83f9135d664232e', u'message': u'Test the new Repository.full_name attribute', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/619eae8d51c5988f0d2889fc767fa677438ba95d', u'sha': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'message': u'Improve coverage of AuthenticatedUser', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}], u'head': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'push_id': 80673538, u'ref': u'refs/heads/topic/RewriteWithGeneratedCode', u'size': 11} ) ### @todo
self.assertEqual( self.event.payload, {u'commits': [{u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'sha': u'5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'message': u'Implement the three authentication schemes', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/cb0313157bf904f2d364377d35d9397b269547a5', u'sha': u'cb0313157bf904f2d364377d35d9397b269547a5', u'message': u"Merge branch 'topic/Authentication' into develop", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'sha': u'0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'message': u'Publish version 0.7', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'sha': u'ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'message': u"Merge branch 'develop'", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/3a3bf4763192ee1234eb0557628133e06f3dfc76', u'sha': u'3a3bf4763192ee1234eb0557628133e06f3dfc76', u'message': u"Merge branch 'master' into topic/RewriteWithGeneratedCode\n\nConflicts:\n\tgithub/Github.py\n\tgithub/Requester.py", u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/608f17794664f61693a3dc05e6056fea8fbef0ff', u'sha': u'608f17794664f61693a3dc05e6056fea8fbef0ff', u'message': u'Restore some form of Authorization header in replay data', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'sha': u'2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'message': u'Allow test without pre-set-up Github', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5b97389988b6fe43e15a079702f6f1671257fb28', u'sha': u'5b97389988b6fe43e15a079702f6f1671257fb28', u'message': u'Test three authentication schemes', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/12747613c5ec00deccf296b8619ad507f7050475', u'sha': u'12747613c5ec00deccf296b8619ad507f7050475', u'message': u'Test Issue.getComments', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2982fa96c5ca75abe717d974d83f9135d664232e', u'sha': u'2982fa96c5ca75abe717d974d83f9135d664232e', u'message': u'Test the new Repository.full_name attribute', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/619eae8d51c5988f0d2889fc767fa677438ba95d', u'sha': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'message': u'Improve coverage of AuthenticatedUser', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}], u'head': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'push_id': 80673538, u'ref': u'refs/heads/topic/RewriteWithGeneratedCode', u'size': 11} )
self.assertEqual( self.event.public, True )
self.assertEqual( self.event.repo.name, "jacquev6/PyGithub" )
self.assertEqual( self.event.type, "PushEvent" )
+3 -4
View File
@@ -9,7 +9,7 @@ class Gist( Framework.TestCase ):
self.assertEquals( self.gist.comments, 0 )
self.assertEquals( self.gist.created_at, "2012-02-29T16:47:12Z" )
self.assertEquals( self.gist.description, "How to error 500 Github API v3, as requested by Rick (GitHub Staff)" )
self.assertEquals( self.gist.files, {u'fail_github.py': {u'raw_url': u'https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py', u'language': u'Python', u'filename': u'fail_github.py', u'content': u'import httplib\nimport base64\nimport json\n\nlogin = ""\npassword = ""\norgName = ""\nrepoName = "FailGithubApi"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( "api.github.com", strict = True )\n cnx.request( verb, url, input, { "Authorization" : "Basic " + base64.b64encode( login + ":" + password ).replace( \'\\n\', \'\' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, "=>", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( "POST", "/user/repos", { "name": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( login, repoName ),\n { "content": "Content of the blob", "encoding": "latin1" }\n)\nt = doRequest(\n "POST", "/repos/%s/%s/git/trees" % ( login, repoName ),\n { "tree" : [ { "path": "foo.bar", "type": "blob", "mode": "100644", "sha": b["sha"] } ] }\n)\nc = doRequest(\n "POST", "/repos/%s/%s/git/commits" % ( login, repoName ),\n { "parents": [], "message": "Message of the commit", "tree": t["sha"] }\n)\ndoRequest(\n "POST", "/repos/%s/%s/git/refs" % ( login, repoName ),\n { "ref": "refs/heads/master", "sha": c["sha"] }\n)\n\n# Fork the repo\ndoRequest( "POST", "/repos/%s/%s/forks?org=%s" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( orgName, repoName ),\n { "content": "Content of the new blob", "encoding": "latin1" }\n)\n', u'type': u'application/python', u'size': 1636}} ) ### @todo
self.assertEquals( self.gist.files, {u'fail_github.py': {u'raw_url': u'https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py', u'language': u'Python', u'filename': u'fail_github.py', u'content': u'import httplib\nimport base64\nimport json\n\nlogin = ""\npassword = ""\norgName = ""\nrepoName = "FailGithubApi"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( "api.github.com", strict = True )\n cnx.request( verb, url, input, { "Authorization" : "Basic " + base64.b64encode( login + ":" + password ).replace( \'\\n\', \'\' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, "=>", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( "POST", "/user/repos", { "name": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( login, repoName ),\n { "content": "Content of the blob", "encoding": "latin1" }\n)\nt = doRequest(\n "POST", "/repos/%s/%s/git/trees" % ( login, repoName ),\n { "tree" : [ { "path": "foo.bar", "type": "blob", "mode": "100644", "sha": b["sha"] } ] }\n)\nc = doRequest(\n "POST", "/repos/%s/%s/git/commits" % ( login, repoName ),\n { "parents": [], "message": "Message of the commit", "tree": t["sha"] }\n)\ndoRequest(\n "POST", "/repos/%s/%s/git/refs" % ( login, repoName ),\n { "ref": "refs/heads/master", "sha": c["sha"] }\n)\n\n# Fork the repo\ndoRequest( "POST", "/repos/%s/%s/forks?org=%s" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( orgName, repoName ),\n { "content": "Content of the new blob", "encoding": "latin1" }\n)\n', u'type': u'application/python', u'size': 1636}} )
self.assertEquals( self.gist.forks, [] )
self.assertEquals( self.gist.git_pull_url, "git://gist.github.com/2729810.git" )
self.assertEquals( self.gist.git_push_url, "git@gist.github.com:2729810.git" )
@@ -37,15 +37,14 @@ class Gist( Framework.TestCase ):
self.gist.edit( "Description edited by PyGithub", { "barbaz.txt": { "content": "File also created by PyGithub" } } )
self.assertEquals( self.gist.description, "Description edited by PyGithub" )
self.assertEquals( self.gist.updated_at, "2012-05-19T07:06:10Z" )
self.assertEquals( self.gist.files, {u'foobar.txt': {u'raw_url': u'https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt', u'language': u'Text', u'filename': u'foobar.txt', u'content': u'File created by PyGithub', u'type': u'text/plain', u'size': 24}, u'barbaz.txt': {u'raw_url': u'https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt', u'language': u'Text', u'filename': u'barbaz.txt', u'content': u'File also created by PyGithub', u'type': u'text/plain', u'size': 29}} ) # Notice that the file is added, not replacing ### @todo
self.assertEquals( self.gist.files, {u'foobar.txt': {u'raw_url': u'https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt', u'language': u'Text', u'filename': u'foobar.txt', u'content': u'File created by PyGithub', u'type': u'text/plain', u'size': 24}, u'barbaz.txt': {u'raw_url': u'https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt', u'language': u'Text', u'filename': u'barbaz.txt', u'content': u'File also created by PyGithub', u'type': u'text/plain', u'size': 29}} ) # Notice that the file is added, not replacing
def testCreateComment( self ):
comment = self.gist.create_comment( "Comment created by PyGithub" )
self.assertEquals( comment.id, 323629 )
def testGetComments( self ):
for comment in self.gist.get_comments(): # There is only one comment
self.assertEquals( comment.id, 323637 ) ### @todo use assertListKeyEqual
self.assertListKeyEqual( self.gist.get_comments(), lambda c: c.id, [ 323637 ] )
def testStarring( self ):
self.assertFalse( self.gist.is_starred() )
+2 -2
View File
@@ -5,7 +5,7 @@ class GistComment( Framework.TestCase ):
Framework.TestCase.setUp( self )
self.comment = self.g.get_gist( "2729810" ).get_comment( 323629 )
def testAttributes( self ): ### @todo Move
def testAttributes( self ):
self.assertEquals( self.comment.body, "Comment created by PyGithub" )
self.assertEquals( self.comment.created_at, "2012-05-19T07:07:57Z" )
self.assertEquals( self.comment.id, 323629 )
@@ -13,7 +13,7 @@ class GistComment( Framework.TestCase ):
self.assertEquals( self.comment.url, "https://api.github.com/gists/comments/323629" )
self.assertEquals( self.comment.user.login, "jacquev6" )
def testEdit( self ): ### @todo Move
def testEdit( self ):
self.comment.edit( "Comment edited by PyGithub" )
self.assertEquals( self.comment.body, "Comment edited by PyGithub" )
self.assertEquals( self.comment.updated_at, "2012-05-19T07:12:32Z" )
+2 -5
View File
@@ -18,7 +18,7 @@ class Issue( Framework.TestCase ):
self.assertListKeyEqual( self.issue.labels, lambda l: l.name, [ "Bug", "Project management", "Question" ] )
self.assertEqual( self.issue.milestone.title, "Version 0.4" )
self.assertEqual( self.issue.number, 28 )
self.assertEqual( self.issue.pull_request, {u'diff_url': None, u'patch_url': None, u'html_url': None} ) ### @todo
self.assertEqual( self.issue.pull_request, {u'diff_url': None, u'patch_url': None, u'html_url': None} )
self.assertEqual( self.issue.state, "closed" )
self.assertEqual( self.issue.title, "Issue created by PyGithub" )
self.assertEqual( self.issue.updated_at, "2012-05-26T14:59:33Z" )
@@ -29,15 +29,12 @@ class Issue( Framework.TestCase ):
self.issue.edit()
def testEditWithAllParameters( self ):
### @todo Variadic argument for labels?
### @todo NamedUser instead of string for assignee
self.issue.edit( "Title edited by PyGithub", "Body edited by PyGithub", "jacquev6", "open", 2, [ "Bug" ] )
self.assertEqual( self.issue.assignee.login, "jacquev6" )
self.assertEqual( self.issue.body, "Body edited by PyGithub" )
self.assertEqual( self.issue.state, "open" )
self.assertEqual( self.issue.title, "Title edited by PyGithub" )
self.assertEqual( len( self.issue.labels ), 1 )
self.assertEqual( self.issue.labels[ 0 ].name, "Bug" )
self.assertListKeyEqual( self.issue.labels, lambda l: l.name, [ "Bug" ] )
def testCreateComment( self ):
comment = self.issue.create_comment( "Comment created by PyGithub" )
-2
View File
@@ -7,5 +7,3 @@ class Issue33( Framework.TestCase ): # https://github.com/jacquev6/PyGithub/issu
def testOpenIssues( self ):
self.assertEqual( len( list( self.repo.get_issues() ) ), 338 )
### @todo testClosedIssues when Repository.get_issues uses its 'state' parameter
-1
View File
@@ -74,7 +74,6 @@ class Organization( Framework.TestCase ):
self.assertFalse( self.org.has_in_members( lyloa ) )
def testGetRepos( self ):
### @todo get_repos( type )
self.assertListKeyEqual( self.org.get_repos(), lambda r: r.name, [ "FatherBeaver", "TestPyGithub" ] )
def testGetEvents( self ):
+3 -8
View File
@@ -7,7 +7,7 @@ class PullRequest( Framework.TestCase ):
def testAttributes( self ):
self.assertEqual( self.pull.additions, 511 )
self.assertEqual( self.pull.base, {u'repo': {u'has_wiki': False, u'mirror_url': None, u'updated_at': u'2012-05-27T10:29:10Z', u'private': False, u'full_name': u'jacquev6/PyGithub', u'owner': {u'url': u'https://api.github.com/users/jacquev6', u'login': u'jacquev6', u'avatar_url': u'https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 327146, u'gravatar_id': u'b68de5ae38616c296fa345d2b9df2225'}, u'id': 3544490, u'size': 188, u'clone_url': u'https://github.com/jacquev6/PyGithub.git', u'forks': 3, u'homepage': u'http://vincent-jacques.net/PyGithub', u'fork': False, u'description': u'Python library implementing the full Github API v3', u'has_downloads': True, u'html_url': u'https://github.com/jacquev6/PyGithub', u'git_url': u'git://github.com/jacquev6/PyGithub.git', u'svn_url': u'https://github.com/jacquev6/PyGithub', u'ssh_url': u'git@github.com:jacquev6/PyGithub.git', u'has_issues': True, u'watchers': 15, u'name': u'PyGithub', u'language': u'Python', u'url': u'https://api.github.com/repos/jacquev6/PyGithub', u'created_at': u'2012-02-25T12:53:47Z', u'pushed_at': u'2012-05-27T10:29:09Z', u'open_issues': 16}, u'sha': u'ed866fc43833802ab553e5ff8581c81bb00dd433', u'ref': u'topic/RewriteWithGeneratedCode', u'user': {u'url': u'https://api.github.com/users/jacquev6', u'login': u'jacquev6', u'avatar_url': u'https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 327146, u'gravatar_id': u'b68de5ae38616c296fa345d2b9df2225'}, u'label': u'jacquev6:topic/RewriteWithGeneratedCode'} ) ### @todo
self.assertEqual( self.pull.base, {u'repo': {u'has_wiki': False, u'mirror_url': None, u'updated_at': u'2012-05-27T10:29:10Z', u'private': False, u'full_name': u'jacquev6/PyGithub', u'owner': {u'url': u'https://api.github.com/users/jacquev6', u'login': u'jacquev6', u'avatar_url': u'https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 327146, u'gravatar_id': u'b68de5ae38616c296fa345d2b9df2225'}, u'id': 3544490, u'size': 188, u'clone_url': u'https://github.com/jacquev6/PyGithub.git', u'forks': 3, u'homepage': u'http://vincent-jacques.net/PyGithub', u'fork': False, u'description': u'Python library implementing the full Github API v3', u'has_downloads': True, u'html_url': u'https://github.com/jacquev6/PyGithub', u'git_url': u'git://github.com/jacquev6/PyGithub.git', u'svn_url': u'https://github.com/jacquev6/PyGithub', u'ssh_url': u'git@github.com:jacquev6/PyGithub.git', u'has_issues': True, u'watchers': 15, u'name': u'PyGithub', u'language': u'Python', u'url': u'https://api.github.com/repos/jacquev6/PyGithub', u'created_at': u'2012-02-25T12:53:47Z', u'pushed_at': u'2012-05-27T10:29:09Z', u'open_issues': 16}, u'sha': u'ed866fc43833802ab553e5ff8581c81bb00dd433', u'ref': u'topic/RewriteWithGeneratedCode', u'user': {u'url': u'https://api.github.com/users/jacquev6', u'login': u'jacquev6', u'avatar_url': u'https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 327146, u'gravatar_id': u'b68de5ae38616c296fa345d2b9df2225'}, u'label': u'jacquev6:topic/RewriteWithGeneratedCode'} )
self.assertEqual( self.pull.body, "Body edited by PyGithub" )
self.assertEqual( self.pull.changed_files, 45 )
self.assertEqual( self.pull.closed_at, "2012-05-27T10:29:07Z" )
@@ -16,7 +16,7 @@ class PullRequest( Framework.TestCase ):
self.assertEqual( self.pull.created_at, "2012-05-27T09:25:36Z" )
self.assertEqual( self.pull.deletions, 384 )
self.assertEqual( self.pull.diff_url, "https://github.com/jacquev6/PyGithub/pull/31.diff" )
self.assertEqual( self.pull.head, {u'repo': {u'has_wiki': False, u'mirror_url': None, u'updated_at': u'2012-05-27T09:09:17Z', u'private': False, u'full_name': u'BeaverSoftware/PyGithub', u'owner': {u'url': u'https://api.github.com/users/BeaverSoftware', u'login': u'BeaverSoftware', u'avatar_url': u'https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png', u'id': 1424031, u'gravatar_id': u'd563e337cac2fdc644e2aaaad1e23266'}, u'id': 4460787, u'size': 176, u'clone_url': u'https://github.com/BeaverSoftware/PyGithub.git', u'forks': 0, u'homepage': u'http://vincent-jacques.net/PyGithub', u'fork': True, u'description': u'Python library implementing the full Github API v3', u'has_downloads': True, u'html_url': u'https://github.com/BeaverSoftware/PyGithub', u'git_url': u'git://github.com/BeaverSoftware/PyGithub.git', u'svn_url': u'https://github.com/BeaverSoftware/PyGithub', u'ssh_url': u'git@github.com:BeaverSoftware/PyGithub.git', u'has_issues': False, u'watchers': 1, u'name': u'PyGithub', u'language': u'Python', u'url': u'https://api.github.com/repos/BeaverSoftware/PyGithub', u'created_at': u'2012-05-27T08:50:04Z', u'pushed_at': u'2012-05-27T09:09:17Z', u'open_issues': 0}, u'sha': u'8a4f306d4b223682dd19410d4a9150636ebe4206', u'ref': u'master', u'user': {u'url': u'https://api.github.com/users/BeaverSoftware', u'login': u'BeaverSoftware', u'avatar_url': u'https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png', u'id': 1424031, u'gravatar_id': u'd563e337cac2fdc644e2aaaad1e23266'}, u'label': u'BeaverSoftware:master'} ) ### @todo
self.assertEqual( self.pull.head, {u'repo': {u'has_wiki': False, u'mirror_url': None, u'updated_at': u'2012-05-27T09:09:17Z', u'private': False, u'full_name': u'BeaverSoftware/PyGithub', u'owner': {u'url': u'https://api.github.com/users/BeaverSoftware', u'login': u'BeaverSoftware', u'avatar_url': u'https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png', u'id': 1424031, u'gravatar_id': u'd563e337cac2fdc644e2aaaad1e23266'}, u'id': 4460787, u'size': 176, u'clone_url': u'https://github.com/BeaverSoftware/PyGithub.git', u'forks': 0, u'homepage': u'http://vincent-jacques.net/PyGithub', u'fork': True, u'description': u'Python library implementing the full Github API v3', u'has_downloads': True, u'html_url': u'https://github.com/BeaverSoftware/PyGithub', u'git_url': u'git://github.com/BeaverSoftware/PyGithub.git', u'svn_url': u'https://github.com/BeaverSoftware/PyGithub', u'ssh_url': u'git@github.com:BeaverSoftware/PyGithub.git', u'has_issues': False, u'watchers': 1, u'name': u'PyGithub', u'language': u'Python', u'url': u'https://api.github.com/repos/BeaverSoftware/PyGithub', u'created_at': u'2012-05-27T08:50:04Z', u'pushed_at': u'2012-05-27T09:09:17Z', u'open_issues': 0}, u'sha': u'8a4f306d4b223682dd19410d4a9150636ebe4206', u'ref': u'master', u'user': {u'url': u'https://api.github.com/users/BeaverSoftware', u'login': u'BeaverSoftware', u'avatar_url': u'https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png', u'id': 1424031, u'gravatar_id': u'd563e337cac2fdc644e2aaaad1e23266'}, u'label': u'BeaverSoftware:master'} )
self.assertEqual( self.pull.html_url, "https://github.com/jacquev6/PyGithub/pull/31" )
self.assertEqual( self.pull.id, 1436215 )
self.assertEqual( self.pull.issue_url, "https://github.com/jacquev6/PyGithub/issues/31" )
@@ -34,7 +34,6 @@ class PullRequest( Framework.TestCase ):
self.assertEqual( self.pull.user.login, "jacquev6" )
def testCreateComment( self ):
### @todo in_reply_to
comment = self.pull.create_comment( "Comment created by PyGithub", "8a4f306d4b223682dd19410d4a9150636ebe4206", "src/github/Issue.py", 5 )
self.assertEqual( comment.id, 886298 )
@@ -58,9 +57,5 @@ class PullRequest( Framework.TestCase ):
def testMerge( self ):
self.assertFalse( self.pull.is_merged() )
status = self.pull.merge() ### @todo message
### @todo PullRequestMergeStatus
# self.assertEqual( status.sha, "" )
# self.assertEqual( status.merged, True )
# self.assertEqual( status.message, "" )
status = self.pull.merge()
self.assertTrue( self.pull.is_merged() )
+1 -1
View File
@@ -11,7 +11,7 @@ class PullRequestFile( Framework.TestCase ):
self.assertEqual( self.file.changes, 2 )
self.assertEqual( self.file.deletions, 1 )
self.assertEqual( self.file.filename, "codegen/templates/GithubObject.py" )
self.assertEqual( self.file.patch, '@@ -70,7 +70,7 @@ def __useAttributes( self, attributes ):\n \n # @todo No need to check if attribute is in attributes when attribute is mandatory\n {% for attribute in class.attributes|dictsort:"name" %}\n- if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None:\n+ if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None: # pragma no branch\n \n {% if attribute.type.cardinality == "scalar" %}\n {% if attribute.type.simple %}' )
self.assertEqual( self.file.patch, '@@ -70,7 +70,7 @@ def __useAttributes( self, attributes ):\n \n # @toto No need to check if attribute is in attributes when attribute is mandatory\n {% for attribute in class.attributes|dictsort:"name" %}\n- if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None:\n+ if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None: # pragma no branch\n \n {% if attribute.type.cardinality == "scalar" %}\n {% if attribute.type.simple %}' )
self.assertEqual( self.file.raw_url, "https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py" )
self.assertEqual( self.file.sha, "8a4f306d4b223682dd19410d4a9150636ebe4206" )
self.assertEqual( self.file.status, "modified" )
+1 -1
View File
@@ -11,5 +11,5 @@ GET /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed
GET /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4974'), ('content-length', '3445'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"bcfd8d733465b9c28525edfc78ede564"'), ('date', 'Sun, 27 May 2012 06:50:52 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"parents":[{"sha":"b46ed0dfde5ad02d3b91eb54a41c5ed960710eae","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/b46ed0dfde5ad02d3b91eb54a41c5ed960710eae"}],"commit":{"message":"Remove completion functions from GitAuthor","author":{"date":"2012-05-09T09:22:33-07:00","name":"Vincent Jacques","email":"vincent@vincent-jacques.net"},"committer":{"date":"2012-05-09T09:22:33-07:00","name":"Vincent Jacques","email":"vincent@vincent-jacques.net"},"tree":{"sha":"4c6bd50994f0f9823f898b1c6c964ad7d4fa11ab","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/4c6bd50994f0f9823f898b1c6c964ad7d4fa11ab"},"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a"},"author":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"committer":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"sha":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","stats":{"total":20,"deletions":20,"additions":0},"url":"https://api.github.com/repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a","files":[{"patch":"@@ -14,22 +14,17 @@ def __init__( self, requester, attributes, lazy ):\n self.__completed = False\n self.__initAttributes()\n self.__useAttributes( attributes )\n- if not lazy:\n- self.__complete()\n \n @property\n def date( self ):\n- self.__completeIfNeeded( self.__date )\n return self.__date\n \n @property\n def email( self ):\n- self.__completeIfNeeded( self.__email )\n return self.__email\n \n @property\n def name( self ):\n- self.__completeIfNeeded( self.__name )\n return self.__name\n \n def __initAttributes( self ):\n@@ -37,21 +32,6 @@ def __initAttributes( self ):\n self.__email = None\n self.__name = None\n \n- def __completeIfNeeded( self, testedAttribute ):\n- if not self.__completed and testedAttribute is None:\n- self.__complete()\n-\n- # @todo Do not generate __complete if type has no url attribute\n- def __complete( self ):\n- status, headers, data = self.__requester.request(\n- \"GET\",\n- self.__url,\n- None,\n- None\n- )\n- self.__useAttributes( data )\n- self.__completed = True\n-\n def __useAttributes( self, attributes ):\n #@todo No need to check if attribute is in attributes when attribute is mandatory\n if \"date\" in attributes and attributes[ \"date\" ] is not None:","status":"modified","deletions":20,"blob_url":"https://github.com/jacquev6/PyGithub/blob/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py","changes":20,"additions":0,"sha":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","raw_url":"https://github.com/jacquev6/PyGithub/raw/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py","filename":"github/GithubObjects/GitAuthor.py"}]}
{"parents":[{"sha":"b46ed0dfde5ad02d3b91eb54a41c5ed960710eae","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/b46ed0dfde5ad02d3b91eb54a41c5ed960710eae"}],"commit":{"message":"Remove completion functions from GitAuthor","author":{"date":"2012-05-09T09:22:33-07:00","name":"Vincent Jacques","email":"vincent@vincent-jacques.net"},"committer":{"date":"2012-05-09T09:22:33-07:00","name":"Vincent Jacques","email":"vincent@vincent-jacques.net"},"tree":{"sha":"4c6bd50994f0f9823f898b1c6c964ad7d4fa11ab","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/4c6bd50994f0f9823f898b1c6c964ad7d4fa11ab"},"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a"},"author":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"committer":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"sha":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","stats":{"total":20,"deletions":20,"additions":0},"url":"https://api.github.com/repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a","files":[{"patch":"@@ -14,22 +14,17 @@ def __init__( self, requester, attributes, lazy ):\n self.__completed = False\n self.__initAttributes()\n self.__useAttributes( attributes )\n- if not lazy:\n- self.__complete()\n \n @property\n def date( self ):\n- self.__completeIfNeeded( self.__date )\n return self.__date\n \n @property\n def email( self ):\n- self.__completeIfNeeded( self.__email )\n return self.__email\n \n @property\n def name( self ):\n- self.__completeIfNeeded( self.__name )\n return self.__name\n \n def __initAttributes( self ):\n@@ -37,21 +32,6 @@ def __initAttributes( self ):\n self.__email = None\n self.__name = None\n \n- def __completeIfNeeded( self, testedAttribute ):\n- if not self.__completed and testedAttribute is None:\n- self.__complete()\n-\n- # @toto Do not generate __complete if type has no url attribute\n- def __complete( self ):\n- status, headers, data = self.__requester.request(\n- \"GET\",\n- self.__url,\n- None,\n- None\n- )\n- self.__useAttributes( data )\n- self.__completed = True\n-\n def __useAttributes( self, attributes ):\n #@toto No need to check if attribute is in attributes when attribute is mandatory\n if \"date\" in attributes and attributes[ \"date\" ] is not None:","status":"modified","deletions":20,"blob_url":"https://github.com/jacquev6/PyGithub/blob/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py","changes":20,"additions":0,"sha":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","raw_url":"https://github.com/jacquev6/PyGithub/raw/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py","filename":"github/GithubObjects/GitAuthor.py"}]}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5 -9
View File
@@ -40,7 +40,7 @@ class Repository( Framework.TestCase ):
self.assertEqual( self.repo.watchers, 15 )
def testEditWithoutArguments( self ):
self.repo.edit( "PyGithub" ) ### @todo Make name an optional parameter
self.repo.edit( "PyGithub" )
def testEditWithAllArguments( self ):
self.repo.edit( "PyGithub", "Description edited by PyGithub", "http://vincent-jacques.net/PyGithub", public = True, has_issues = True, has_wiki = False, has_downloads = True )
@@ -64,7 +64,7 @@ class Repository( Framework.TestCase ):
self.assertEqual( issue.number, 28 )
def testCreateIssueWithAllArguments( self ):
issue = self.repo.create_issue( "Issue also created by PyGithub", "Body created by PyGithub", "jacquev6", 2, [ "Question" ] ) ### @todo Use typed arguments
issue = self.repo.create_issue( "Issue also created by PyGithub", "Body created by PyGithub", "jacquev6", 2, [ "Question" ] )
self.assertEqual( issue.number, 30 )
def testCreateLabel( self ):
@@ -80,7 +80,6 @@ class Repository( Framework.TestCase ):
self.assertEqual( label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+silly+name+%25+%2A+%2B+created+by+PyGithub" )
def testCreateHookWithMinimalParameters( self ):
### @todo Implement https://api.github.com/hooks, which is not described, but refered by http://developer.github.com/v3/repos/hooks/#create-a-hook
hook = self.repo.create_hook( "web", { "url": "http://foobar.com" } )
self.assertEqual( hook.active, True )
self.assertEqual( hook.config, { "url": "http://foobar.com" } )
@@ -145,7 +144,7 @@ class Repository( Framework.TestCase ):
"path": "Foobar.txt",
"mode": "100644",
"type": "blob",
"content": "File created by PyGithub" ### @todo create_git_tree with sha instead of content
"content": "File created by PyGithub"
} ]
)
self.assertEqual( tree.sha, "41cf8c178c636a018d537cb20daae09391efd70b" )
@@ -156,7 +155,7 @@ class Repository( Framework.TestCase ):
"path": "Barbaz.txt",
"mode": "100644",
"type": "blob",
"content": "File also created by PyGithub" ### @todo create_git_tree with sha instead of content
"content": "File also created by PyGithub"
} ],
"41cf8c178c636a018d537cb20daae09391efd70b"
)
@@ -192,7 +191,6 @@ class Repository( Framework.TestCase ):
self.assertFalse( self.repo.has_in_collaborators( lyloa ) )
def testCompare( self ):
### @todo Structure ComparisionResult
self.assertEqual(
self.repo.compare( "v0.6", "v0.7" ),
{
@@ -282,8 +280,7 @@ class Repository( Framework.TestCase ):
self.assertListKeyEqual( self.repo.get_labels(), lambda l: l.name, [ "Refactoring", "Public interface", "Functionalities", "Project management", "Bug", "Question" ] )
def testGetLanguages( self ):
### @todo Structure ?
self.assertEqual( self.repo.get_languages(), { "Python": 127266, "Shell": 673} )
self.assertEqual( self.repo.get_languages(), { "Python": 127266, "Shell": 673} )
def testGetMilestones( self ):
self.assertListKeyEqual( self.repo.get_milestones(), lambda m: m.id, [ 93547 ] )
@@ -310,5 +307,4 @@ class Repository( Framework.TestCase ):
self.assertEqual( pull.id, 1436310 )
def testGetPulls( self ):
### @todo Create another PullRequest and re-record this test (at the same time as testCreatePullFromIssue)
self.assertListKeyEqual( self.repo.get_pulls(), lambda p: p.id, [ 1436310 ] )