diff options
author | 2011-11-15 23:26:31 +0100 | |
---|---|---|
committer | 2011-11-15 23:26:31 +0100 | |
commit | 9e7d4e655d966b325cc9db190273f99220b6041b (patch) | |
tree | d571b474f0ead315667ff6fbff43fde594e0b071 /github3/tests | |
parent | Complete anonymous User handler test (diff) | |
download | python-github3-9e7d4e655d966b325cc9db190273f99220b6041b.tar.xz python-github3-9e7d4e655d966b325cc9db190273f99220b6041b.zip |
API change: Added gravatar_id in User model
Also fix some bugs, update test and PEP8
Diffstat (limited to 'github3/tests')
-rw-r--r-- | github3/tests/converters_test.py | 7 | ||||
-rw-r--r-- | github3/tests/fixtures.py | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/github3/tests/converters_test.py b/github3/tests/converters_test.py index 315477c..66eedc3 100644 --- a/github3/tests/converters_test.py +++ b/github3/tests/converters_test.py @@ -7,8 +7,10 @@ from unittest import TestCase from datetime import datetime API_STUB = { - 'test_str': 'string', 'test_int': 1, - 'test_date': '2008-01-14T04:33:35Z', 'test_bool': True, + 'test_str': 'string', + 'test_int': 1, + 'test_date': '2008-01-14T04:33:35Z', + 'test_bool': True, 'map': {'test_str': 'string'}, 'dict_map': { 'map1': { @@ -55,6 +57,7 @@ class TestModelizer(TestCase): def test_loads(self): parsed_model = self.modelizer.loads(API_STUB) + self.assertEquals(len(parsed_model), len(API_STUB)) self.assertEquals(parsed_model.test_str, 'string') self.assertEquals(parsed_model.test_int, 1) self.assertEquals( diff --git a/github3/tests/fixtures.py b/github3/tests/fixtures.py index 469b00a..02086f8 100644 --- a/github3/tests/fixtures.py +++ b/github3/tests/fixtures.py @@ -5,6 +5,7 @@ GET_USER = { "login": "octocat", "id": 1, "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "somehexcode", "url": "https://api.github.com/users/octocat", "name": "monalisa octocat", "company": "GitHub", @@ -24,24 +25,29 @@ GET_USER = { GET_LINK = '<https://api.github.com/gists/public?page=2>; rel="next", \ <https://api.github.com/gists/public?page=5>; rel="last"' + GET_RESOURCES = [ {'login': 'octocat'}, {'login': 'octocat'} ] + GET_SHORT_USERS = [ { "login": "octocat", "id": 1, "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "somehexcode", "url": "https://api.github.com/users/octocat" }, { "login": "octocat", "id": 1, "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "somehexcode", "url": "https://api.github.com/users/octocat" }, ] + GET_SHORT_ORGS = [ { "login": "github", @@ -63,6 +69,7 @@ GET_SHORT_REPOS = [ "login": "octocat", "id": 1, "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "somehexcode", "url": "https://api.github.com/users/octocat" }, "name": "Hello-World", @@ -80,6 +87,7 @@ GET_SHORT_REPOS = [ "created_at": "2011-01-26T19:01:12Z" } ] + GET_SHORT_GISTS = [ { "url": "https://api.github.com/gists/1", @@ -90,6 +98,7 @@ GET_SHORT_GISTS = [ "login": "octocat", "id": 1, "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "somehexcode", "url": "https://api.github.com/users/octocat" }, "files": { |