Fix lazy completion!!! (issue #139)

This commit is contained in:
Vincent Jacques
2013-02-08 08:33:58 +01:00
parent f533731151
commit ce05a0185d
3 changed files with 3 additions and 8 deletions
+1 -1
View File
@@ -69,4 +69,4 @@ class GithubObject(BasicGithubObject):
None
)
self._useAttributes(data)
self._completed = True
self.__completed = True
+2 -2
View File
@@ -25,5 +25,5 @@ class Issue139(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issu
def testCompletion(self):
self.assertEqual(self.user._GithubObject__completed, False)
self.assertEqual(self.user.name, "Ian Ozsvald")
self.assertEqual(self.user._GithubObject__completed, False) # Should be True
self.assertEqual(self.user.plan, None) # Should NOT fire a new request to Github
self.assertEqual(self.user._GithubObject__completed, True)
self.assertEqual(self.user.plan, None)
@@ -3,8 +3,3 @@ https GET api.github.com None /users/ianozsvald {'Authorization': 'Basic login_a
[('status', '200 OK'), ('x-ratelimit-remaining', '4991'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '1278'), ('server', 'GitHub.com'), ('last-modified', 'Thu, 07 Feb 2013 22:12:31 GMT'), ('connection', 'keep-alive'), ('etag', '"c7e39237717a6e60232f1dde7c4dcb73"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Fri, 08 Feb 2013 07:27:51 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"type":"User","public_repos":26,"company":"Mor Consulting Ltd","events_url":"https://api.github.com/users/ianozsvald/events{/privacy}","followers_url":"https://api.github.com/users/ianozsvald/followers","following":4,"created_at":"2010-05-11T10:22:02Z","hireable":true,"subscriptions_url":"https://api.github.com/users/ianozsvald/subscriptions","gists_url":"https://api.github.com/users/ianozsvald/gists{/gist_id}","following_url":"https://api.github.com/users/ianozsvald/following","url":"https://api.github.com/users/ianozsvald","html_url":"https://github.com/ianozsvald","location":"London, UK","bio":null,"starred_url":"https://api.github.com/users/ianozsvald/starred{/owner}{/repo}","avatar_url":"https://secure.gravatar.com/avatar/3d644406158b4d440111903db1f62622?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","followers":45,"email":null,"gravatar_id":"3d644406158b4d440111903db1f62622","repos_url":"https://api.github.com/users/ianozsvald/repos","organizations_url":"https://api.github.com/users/ianozsvald/orgs","public_gists":2,"name":"Ian Ozsvald","login":"ianozsvald","updated_at":"2013-02-07T22:12:31Z","blog":"ianozsvald.com","received_events_url":"https://api.github.com/users/ianozsvald/received_events","id":273210}
https GET api.github.com None /users/ianozsvald {'Authorization': 'Basic login_and_password_removed'} null
200
[('status', '200 OK'), ('content-length', '1278'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4990'), ('server', 'GitHub.com'), ('last-modified', 'Thu, 07 Feb 2013 22:12:31 GMT'), ('connection', 'keep-alive'), ('etag', '"c7e39237717a6e60232f1dde7c4dcb73"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Fri, 08 Feb 2013 07:27:51 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"public_gists":2,"type":"User","public_repos":26,"company":"Mor Consulting Ltd","hireable":true,"repos_url":"https://api.github.com/users/ianozsvald/repos","followers_url":"https://api.github.com/users/ianozsvald/followers","following":4,"created_at":"2010-05-11T10:22:02Z","subscriptions_url":"https://api.github.com/users/ianozsvald/subscriptions","starred_url":"https://api.github.com/users/ianozsvald/starred{/owner}{/repo}","gists_url":"https://api.github.com/users/ianozsvald/gists{/gist_id}","following_url":"https://api.github.com/users/ianozsvald/following","url":"https://api.github.com/users/ianozsvald","location":"London, UK","bio":null,"received_events_url":"https://api.github.com/users/ianozsvald/received_events","blog":"ianozsvald.com","followers":45,"email":null,"gravatar_id":"3d644406158b4d440111903db1f62622","html_url":"https://github.com/ianozsvald","organizations_url":"https://api.github.com/users/ianozsvald/orgs","name":"Ian Ozsvald","login":"ianozsvald","updated_at":"2013-02-07T22:12:31Z","id":273210,"events_url":"https://api.github.com/users/ianozsvald/events{/privacy}","avatar_url":"https://secure.gravatar.com/avatar/3d644406158b4d440111903db1f62622?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"}