diff --git a/README.rst b/README.rst index f5a8592c..86a87645 100644 --- a/README.rst +++ b/README.rst @@ -20,6 +20,7 @@ Starting today (September 5th, 2013), we now need more than 8 bits to store the --------------------------------------------------------------------------------------------------------------- * `Accept `__ strings as well as ``Label`` objects in ``Issue.add_to_labels``, ``Issue.remove_from_labels`` and ``Issue.set_labels``. Thank you `acdha `__ for asking +* `Implement `__ equality comparison for *completable* github objects (ie. those who have a ``url`` attribute). Warning, comparison is still not implemented for non-completable objects. This will be done in version 2.0 of PyGithub. Thank you `OddBloke `__ for asking Twitter ------- diff --git a/github/GithubObject.py b/github/GithubObject.py index ac79a78e..0bd1bda1 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -213,6 +213,12 @@ class CompletableGithubObject(GithubObject): GithubObject.__init__(self, requester, headers, attributes, completed) self.__completed = completed + def __eq__(self, other): + return other.__class__ is self.__class__ and other._url.value == self._url.value + + def __ne__(self, other): + return not self == other + def _completeIfNotSet(self, value): if value is NotSet: self._completeIfNeeded() diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index 36f9b85a..de6ca0f2 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -71,6 +71,7 @@ from ConditionalRequestUpdate import * from Persistence import * from ExposeAllAttributes import * from BadAttributes import * +from Equality import * from Issue33 import * from Issue50 import * diff --git a/github/tests/Equality.py b/github/tests/Equality.py new file mode 100755 index 00000000..d8df93d0 --- /dev/null +++ b/github/tests/Equality.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +############################ Copyrights and license ############################ +# # +# Copyright 2012 Vincent Jacques # +# Copyright 2012 Zearin # +# Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # +# # +# This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # +# # +# PyGithub is free software: you can redistribute it and/or modify it under # +# the terms of the GNU Lesser General Public License as published by the Free # +# Software Foundation, either version 3 of the License, or (at your option) # +# any later version. # +# # +# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # +# details. # +# # +# You should have received a copy of the GNU Lesser General Public License # +# along with PyGithub. If not, see . # +# # +################################################################################ + +import Framework + + +class Equality(Framework.TestCase): + def testUserEquality(self): + u1 = self.g.get_user("jacquev6") + u2 = self.g.get_user("jacquev6") + self.assertTrue(u1 == u2) + self.assertFalse(u1 != u2) + self.assertEqual(u1, u2) + + def testUserDifference(self): + u1 = self.g.get_user("jacquev6") + u2 = self.g.get_user("OddBloke") + self.assertFalse(u1 == u2) + self.assertTrue(u1 != u2) + self.assertNotEqual(u1, u2) + + def testBranchEquality(self): + # Erf, equality of NonCompletableGithubObjects will be difficult to implement + # because even their _rawData can differ. (Here, the avatar_url is not equal) + # (CompletableGithubObjects are compared by their API url, which is a good key) + r = self.g.get_user().get_repo("PyGithub") + b1 = r.get_branch("develop") + b2 = r.get_branch("develop") + self.assertNotEqual(b1._rawData, b2._rawData) diff --git a/github/tests/ReplayData/Equality.testBranchEquality.txt b/github/tests/ReplayData/Equality.testBranchEquality.txt new file mode 100644 index 00000000..b1ff3f14 --- /dev/null +++ b/github/tests/ReplayData/Equality.testBranchEquality.txt @@ -0,0 +1,44 @@ +https +GET +api.github.com +None +/user +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('x-github-request-id', '4C79374B:3449:3070918:52802141'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, Accept-Encoding'), ('content-length', '1494'), ('server', 'GitHub.com'), ('last-modified', 'Sun, 10 Nov 2013 23:46:02 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"fe0984faabdc64453d942c3e3a992a39"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 11 Nov 2013 00:13:54 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1384130958')] +{"login":"jacquev6","id":327146,"avatar_url":"https://2.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false,"name":"Vincent Jacques","company":"Amazon","blog":"http://vincent-jacques.net","location":"Seattle, WA, United States","email":"vincent@vincent-jacques.net","hireable":false,"bio":"","public_repos":18,"followers":29,"following":43,"created_at":"2010-07-09T06:10:06Z","updated_at":"2013-11-10T23:46:02Z","public_gists":5,"total_private_repos":3,"owned_private_repos":3,"disk_usage":90970,"collaborators":0,"plan":{"name":"micro","space":614400,"collaborators":1,"private_repos":5},"private_gists":6} + +https +GET +api.github.com +None +/repos/jacquev6/PyGithub +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('x-github-request-id', '4C79374B:3449:3070AAE:52802143'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, Accept-Encoding'), ('content-length', '4792'), ('server', 'GitHub.com'), ('last-modified', 'Sun, 10 Nov 2013 23:46:02 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"fe0984faabdc64453d942c3e3a992a39"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 11 Nov 2013 00:13:56 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1384130958')] +{"id":3544490,"name":"PyGithub","full_name":"jacquev6/PyGithub","owner":{"login":"jacquev6","id":327146,"avatar_url":"https://0.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacquev6/PyGithub","description":"Python library implementing the full Github API v3","fork":false,"url":"https://api.github.com/repos/jacquev6/PyGithub","forks_url":"https://api.github.com/repos/jacquev6/PyGithub/forks","keys_url":"https://api.github.com/repos/jacquev6/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquev6/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquev6/PyGithub/teams","hooks_url":"https://api.github.com/repos/jacquev6/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/jacquev6/PyGithub/events","assignees_url":"https://api.github.com/repos/jacquev6/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/jacquev6/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/jacquev6/PyGithub/tags","blobs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquev6/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquev6/PyGithub/languages","stargazers_url":"https://api.github.com/repos/jacquev6/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/jacquev6/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/jacquev6/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/jacquev6/PyGithub/subscription","commits_url":"https://api.github.com/repos/jacquev6/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquev6/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/comments/{number}","contents_url":"https://api.github.com/repos/jacquev6/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/jacquev6/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquev6/PyGithub/merges","archive_url":"https://api.github.com/repos/jacquev6/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquev6/PyGithub/downloads","issues_url":"https://api.github.com/repos/jacquev6/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/jacquev6/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquev6/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquev6/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquev6/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/jacquev6/PyGithub/releases{/id}","created_at":"2012-02-25T12:53:47Z","updated_at":"2013-11-10T23:46:02Z","pushed_at":"2013-11-10T23:45:59Z","git_url":"git://github.com/jacquev6/PyGithub.git","ssh_url":"git@github.com:jacquev6/PyGithub.git","clone_url":"https://github.com/jacquev6/PyGithub.git","svn_url":"https://github.com/jacquev6/PyGithub","homepage":"http://jacquev6.github.com/PyGithub","size":8630,"stargazers_count":291,"watchers_count":291,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":79,"mirror_url":null,"open_issues_count":17,"forks":79,"open_issues":17,"watchers":291,"default_branch":"master","master_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"network_count":79,"subscribers_count":26} + +https +GET +api.github.com +None +/repos/jacquev6/PyGithub/branches/develop +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('x-github-request-id', '4C79374B:3449:3070BCA:52802144'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, Accept-Encoding'), ('content-length', '3500'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('etag', '"3fbf42ebb571f240626352110b71e641"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 11 Nov 2013 00:13:57 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1384130958')] +{"name":"develop","commit":{"sha":"22f366b540a302036784afc979e28569ede388df","commit":{"author":{"name":"Vincent Jacques","email":"vincent@vincent-jacques.net","date":"2013-11-10T23:45:33Z"},"committer":{"name":"Vincent Jacques","email":"vincent@vincent-jacques.net","date":"2013-11-10T23:45:33Z"},"message":"Accept strings as well as Label objects (#202)\n\nThis should be more generic, but it's a wig work to do it\neverywhere. Let's keep that in mind for V2.","tree":{"sha":"da52b9c276aa8fa9dfda274e6dbcbe7b0dfd132f","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/da52b9c276aa8fa9dfda274e6dbcbe7b0dfd132f"},"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/22f366b540a302036784afc979e28569ede388df","comment_count":0},"url":"https://api.github.com/repos/jacquev6/PyGithub/commits/22f366b540a302036784afc979e28569ede388df","html_url":"https://github.com/jacquev6/PyGithub/commit/22f366b540a302036784afc979e28569ede388df","comments_url":"https://api.github.com/repos/jacquev6/PyGithub/commits/22f366b540a302036784afc979e28569ede388df/comments","author":{"login":"jacquev6","id":327146,"avatar_url":"https://1.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false},"committer":{"login":"jacquev6","id":327146,"avatar_url":"https://1.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false},"parents":[{"sha":"54f718a15770579a37ffbe7ae94ad30003407786","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/54f718a15770579a37ffbe7ae94ad30003407786","html_url":"https://github.com/jacquev6/PyGithub/commit/54f718a15770579a37ffbe7ae94ad30003407786"}]},"_links":{"self":"https://api.github.com/repos/jacquev6/PyGithub/branches/develop","html":"https://github.com/jacquev6/PyGithub/tree/develop"}} + +https +GET +api.github.com +None +/repos/jacquev6/PyGithub/branches/develop +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4984'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('x-github-request-id', '4C79374B:344A:3DD0893:52802146'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, Accept-Encoding'), ('content-length', '3500'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('etag', '"1d4efa84ec4f76163fb0c421d3f01d85"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 11 Nov 2013 00:13:58 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1384130958')] +{"name":"develop","commit":{"sha":"22f366b540a302036784afc979e28569ede388df","commit":{"author":{"name":"Vincent Jacques","email":"vincent@vincent-jacques.net","date":"2013-11-10T23:45:33Z"},"committer":{"name":"Vincent Jacques","email":"vincent@vincent-jacques.net","date":"2013-11-10T23:45:33Z"},"message":"Accept strings as well as Label objects (#202)\n\nThis should be more generic, but it's a wig work to do it\neverywhere. Let's keep that in mind for V2.","tree":{"sha":"da52b9c276aa8fa9dfda274e6dbcbe7b0dfd132f","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/da52b9c276aa8fa9dfda274e6dbcbe7b0dfd132f"},"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/22f366b540a302036784afc979e28569ede388df","comment_count":0},"url":"https://api.github.com/repos/jacquev6/PyGithub/commits/22f366b540a302036784afc979e28569ede388df","html_url":"https://github.com/jacquev6/PyGithub/commit/22f366b540a302036784afc979e28569ede388df","comments_url":"https://api.github.com/repos/jacquev6/PyGithub/commits/22f366b540a302036784afc979e28569ede388df/comments","author":{"login":"jacquev6","id":327146,"avatar_url":"https://0.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false},"committer":{"login":"jacquev6","id":327146,"avatar_url":"https://0.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false},"parents":[{"sha":"54f718a15770579a37ffbe7ae94ad30003407786","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/54f718a15770579a37ffbe7ae94ad30003407786","html_url":"https://github.com/jacquev6/PyGithub/commit/54f718a15770579a37ffbe7ae94ad30003407786"}]},"_links":{"self":"https://api.github.com/repos/jacquev6/PyGithub/branches/develop","html":"https://github.com/jacquev6/PyGithub/tree/develop"}} + diff --git a/github/tests/ReplayData/Equality.testUserDifference.txt b/github/tests/ReplayData/Equality.testUserDifference.txt new file mode 100644 index 00000000..94ded425 --- /dev/null +++ b/github/tests/ReplayData/Equality.testUserDifference.txt @@ -0,0 +1,22 @@ +https +GET +api.github.com +None +/users/jacquev6 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4982'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('x-github-request-id', '4C79374B:344A:3DD0CA2:52802148'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, Accept-Encoding'), ('content-length', '1494'), ('server', 'GitHub.com'), ('last-modified', 'Sun, 10 Nov 2013 23:46:02 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"fe0984faabdc64453d942c3e3a992a39"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 11 Nov 2013 00:14:01 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1384130958')] +{"login":"jacquev6","id":327146,"avatar_url":"https://0.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false,"name":"Vincent Jacques","company":"Amazon","blog":"http://vincent-jacques.net","location":"Seattle, WA, United States","email":"vincent@vincent-jacques.net","hireable":false,"bio":"","public_repos":18,"followers":29,"following":43,"created_at":"2010-07-09T06:10:06Z","updated_at":"2013-11-10T23:46:02Z","public_gists":5,"total_private_repos":3,"owned_private_repos":3,"disk_usage":90970,"collaborators":0,"plan":{"name":"micro","space":614400,"collaborators":1,"private_repos":5},"private_gists":6} + +https +GET +api.github.com +None +/users/OddBloke +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4981'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('x-github-request-id', '4C79374B:3448:4124825:52802149'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, Accept-Encoding'), ('content-length', '1130'), ('server', 'GitHub.com'), ('last-modified', 'Sat, 09 Nov 2013 21:41:44 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"13ce14e257e7adc5b376a1f5e03d5c1d"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 11 Nov 2013 00:14:02 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1384130958')] +{"login":"OddBloke","id":62736,"avatar_url":"https://2.gravatar.com/avatar/af881deb1a7ef0a1f568e18cd967c0d3?d=https%3A%2F%2Fidenticons.github.com%2F29c5b1cb9b545c69846a6542a71338bd.png&r=x","gravatar_id":"af881deb1a7ef0a1f568e18cd967c0d3","url":"https://api.github.com/users/OddBloke","html_url":"https://github.com/OddBloke","followers_url":"https://api.github.com/users/OddBloke/followers","following_url":"https://api.github.com/users/OddBloke/following{/other_user}","gists_url":"https://api.github.com/users/OddBloke/gists{/gist_id}","starred_url":"https://api.github.com/users/OddBloke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OddBloke/subscriptions","organizations_url":"https://api.github.com/users/OddBloke/orgs","repos_url":"https://api.github.com/users/OddBloke/repos","events_url":"https://api.github.com/users/OddBloke/events{/privacy}","received_events_url":"https://api.github.com/users/OddBloke/received_events","type":"User","site_admin":false,"public_repos":32,"followers":8,"following":1,"created_at":"2009-03-12T12:40:32Z","updated_at":"2013-11-09T21:41:44Z","public_gists":12} + diff --git a/github/tests/ReplayData/Equality.testUserEquality.txt b/github/tests/ReplayData/Equality.testUserEquality.txt new file mode 100644 index 00000000..5d1aeb5e --- /dev/null +++ b/github/tests/ReplayData/Equality.testUserEquality.txt @@ -0,0 +1,22 @@ +https +GET +api.github.com +None +/users/jacquev6 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4980'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('x-github-request-id', '4C79374B:3449:30711F6:5280214B'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, Accept-Encoding'), ('content-length', '1494'), ('server', 'GitHub.com'), ('last-modified', 'Sun, 10 Nov 2013 23:46:02 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"fe0984faabdc64453d942c3e3a992a39"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 11 Nov 2013 00:14:03 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1384130958')] +{"login":"jacquev6","id":327146,"avatar_url":"https://0.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false,"name":"Vincent Jacques","company":"Amazon","blog":"http://vincent-jacques.net","location":"Seattle, WA, United States","email":"vincent@vincent-jacques.net","hireable":false,"bio":"","public_repos":18,"followers":29,"following":43,"created_at":"2010-07-09T06:10:06Z","updated_at":"2013-11-10T23:46:02Z","public_gists":5,"total_private_repos":3,"owned_private_repos":3,"disk_usage":90970,"collaborators":0,"plan":{"name":"micro","space":614400,"collaborators":1,"private_repos":5},"private_gists":6} + +https +GET +api.github.com +None +/users/jacquev6 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4979'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes'), ('x-github-request-id', '4C79374B:3447:28CA230:5280214C'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, Accept-Encoding'), ('content-length', '1494'), ('server', 'GitHub.com'), ('last-modified', 'Sun, 10 Nov 2013 23:46:02 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"fe0984faabdc64453d942c3e3a992a39"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 11 Nov 2013 00:14:04 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1384130958')] +{"login":"jacquev6","id":327146,"avatar_url":"https://1.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false,"name":"Vincent Jacques","company":"Amazon","blog":"http://vincent-jacques.net","location":"Seattle, WA, United States","email":"vincent@vincent-jacques.net","hireable":false,"bio":"","public_repos":18,"followers":29,"following":43,"created_at":"2010-07-09T06:10:06Z","updated_at":"2013-11-10T23:46:02Z","public_gists":5,"total_private_repos":3,"owned_private_repos":3,"disk_usage":90970,"collaborators":0,"plan":{"name":"micro","space":614400,"collaborators":1,"private_repos":5},"private_gists":6} +