diff --git a/NewIntegrationTest.py b/NewIntegrationTest.py index c3d914ed..537e0763 100644 --- a/NewIntegrationTest.py +++ b/NewIntegrationTest.py @@ -197,6 +197,20 @@ class GitBlob( TestCase ): self.assertEqual( self.b.sha, "53bce9fa919b4544e67275089b3ec5b44be20667" ) self.assertEqual( self.b.url, "https://api.github.com/repos/jacquev6/PyGithub/git/blobs/53bce9fa919b4544e67275089b3ec5b44be20667" ) +class GitCommit( TestCase ): + def setUp( self ): + TestCase.setUp( self ) + self.c = self.g.get_user().get_repo( "PyGithub" ).get_git_commit( "4303c5b90e2216d927155e9609436ccb8984c495" ) + + def testAttributes( self ): + self.assertEqual( self.c.author, { "date": "2012-04-17T10:55:16-07:00", "email": "vincent@vincent-jacques.net", "name": "Vincent Jacques" } ) ### @todo Structure + self.assertEqual( self.c.committer, { "date": "2012-04-17T10:55:16-07:00", "email": "vincent@vincent-jacques.net", "name": "Vincent Jacques" } ) ### @todo Structure + self.assertEqual( self.c.message, "Merge branch 'develop'\n" ) + self.assertEqual( self.c.parents, [{u'url': u'https://api.github.com/repos/jacquev6/PyGithub/git/commits/936f4a97f1a86392637ec002bbf89ff036a5062d', u'sha': u'936f4a97f1a86392637ec002bbf89ff036a5062d'}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/git/commits/2a7e80e6421c5d4d201d60619068dea6bae612cb', u'sha': u'2a7e80e6421c5d4d201d60619068dea6bae612cb'}] ) ### @todo Structure + self.assertEqual( self.c.sha, "4303c5b90e2216d927155e9609436ccb8984c495" ) + self.assertEqual( self.c.tree.sha, "f492784d8ca837779650d1fb406a1a3587a764ad" ) + self.assertEqual( self.c.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495" ) + class GitTree( TestCase ): def setUp( self ): TestCase.setUp( self ) diff --git a/ReplayDataForNewIntegrationTest/GitCommit.setUp.txt b/ReplayDataForNewIntegrationTest/GitCommit.setUp.txt new file mode 100644 index 00000000..5d039d89 --- /dev/null +++ b/ReplayDataForNewIntegrationTest/GitCommit.setUp.txt @@ -0,0 +1,15 @@ +GET /user {} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0be59bac98409dae58540c58f0c3bd76"'), ('date', 'Wed, 09 May 2012 13:59:07 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"public_repos":10,"html_url":"https://github.com/jacquev6","type":"User","url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","disk_usage":16696,"plan":{"private_repos":5,"collaborators":1,"space":614400,"name":"micro"},"login":"jacquev6","total_private_repos":5,"collaborators":0,"email":"vincent@vincent-jacques.net","owned_private_repos":5,"public_gists":1,"created_at":"2010-07-09T06:10:06Z","company":"Criteo","location":"Paris, France","hireable":false,"followers":13,"following":24,"name":"Vincent Jacques","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","private_gists":5,"bio":"","id":327146,"blog":"http://vincent-jacques.net"} + +GET /repos/jacquev6/PyGithub {} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4995'), ('content-length', '1097'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"8b91cd1456a5d4ef451946f882d9161e"'), ('date', 'Wed, 09 May 2012 13:59:07 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"mirror_url":null,"homepage":"http://vincent-jacques.net/PyGithub","clone_url":"https://github.com/jacquev6/PyGithub.git","html_url":"https://github.com/jacquev6/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","has_downloads":true,"watchers":13,"permissions":{"admin":true,"pull":true,"push":true},"has_wiki":false,"has_issues":true,"fork":false,"forks":2,"language":"Python","size":212,"description":"Python library implementing the full Github API v3","git_url":"git://github.com/jacquev6/PyGithub.git","private":false,"created_at":"2012-02-25T12:53:47Z","open_issues":15,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","login":"jacquev6","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","id":327146},"name":"PyGithub","pushed_at":"2012-05-08T19:27:43Z","id":3544490,"ssh_url":"git@github.com:jacquev6/PyGithub.git","updated_at":"2012-05-08T19:27:43Z"} + +GET /repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495 {} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '910'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"eabd190c639b57d447ea6d3463da7aae"'), ('date', 'Wed, 09 May 2012 13:59:08 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495","message":"Merge branch 'develop'\n","committer":{"email":"vincent@vincent-jacques.net","date":"2012-04-17T10:55:16-07:00","name":"Vincent Jacques"},"sha":"4303c5b90e2216d927155e9609436ccb8984c495","parents":[{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/936f4a97f1a86392637ec002bbf89ff036a5062d","sha":"936f4a97f1a86392637ec002bbf89ff036a5062d"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/2a7e80e6421c5d4d201d60619068dea6bae612cb","sha":"2a7e80e6421c5d4d201d60619068dea6bae612cb"}],"tree":{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/f492784d8ca837779650d1fb406a1a3587a764ad","sha":"f492784d8ca837779650d1fb406a1a3587a764ad"},"author":{"email":"vincent@vincent-jacques.net","date":"2012-04-17T10:55:16-07:00","name":"Vincent Jacques"}} +