Work-around Issue278

This commit is contained in:
Vincent Jacques
2014-10-07 18:45:30 -07:00
parent 9962ae2268
commit aadc286839
5 changed files with 213 additions and 1 deletions
+1 -1
View File
@@ -174,7 +174,7 @@ class PaginatedList(PaginatedListBase):
content = [
self.__contentClass(self.__requester, headers, element, completed=False)
for element in data
for element in data if element is not None
]
if self._reversed:
return content[::-1]
+1
View File
@@ -89,3 +89,4 @@ from Issue158 import *
from Issue174 import *
from Issue214 import *
from Issue216 import *
from Issue278 import *
+35
View File
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# #
# 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 <http://www.gnu.org/licenses/>. #
# #
# ##############################################################################
import Framework
# Replay data forged by adding nulls to PaginatedList.setUp.txt and PaginatedList.testIteration.txt
class Issue278(Framework.TestCase):
def setUp(self):
Framework.TestCase.setUp(self)
self.repo = self.g.get_user("openframeworks").get_repo("openFrameworks")
self.list = self.repo.get_issues()
def testIteration(self):
self.assertEqual(len(list(self.list)), 333)
@@ -0,0 +1,22 @@
https
GET
api.github.com
None
/users/openframeworks
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4929'), ('content-length', '564'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"cddd0710dc9490553aecd937e15d1136"'), ('date', 'Tue, 29 May 2012 19:36:56 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"type":"User","hireable":false,"url":"https://api.github.com/users/openframeworks","html_url":"https://github.com/openframeworks","public_gists":0,"blog":null,"bio":null,"public_repos":12,"company":null,"gravatar_id":"a858611b044a8302ab14cfe752e17369","login":"openframeworks","email":"","followers":399,"name":null,"avatar_url":"https://secure.gravatar.com/avatar/a858611b044a8302ab14cfe752e17369?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","created_at":"2009-10-21T21:54:37Z","location":null,"id":142866,"following":4}
https
GET
api.github.com
None
/repos/openframeworks/openFrameworks
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
null
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4928'), ('content-length', '1253'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e7459f63683768d5b53fc4b246d13a10"'), ('date', 'Tue, 29 May 2012 19:36:56 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"clone_url":"https://github.com/openframeworks/openFrameworks.git","has_downloads":true,"watchers":1745,"updated_at":"2012-05-29T19:23:07Z","permissions":{"pull":true,"admin":false,"push":false},"homepage":"http://openframeworks.cc","url":"https://api.github.com/repos/openframeworks/openFrameworks","html_url":"https://github.com/openframeworks/openFrameworks","has_wiki":true,"has_issues":true,"fork":false,"forks":349,"size":4232,"git_url":"git://github.com/openframeworks/openFrameworks.git","private":false,"open_issues":333,"svn_url":"https://github.com/openframeworks/openFrameworks","owner":{"url":"https://api.github.com/users/openframeworks","gravatar_id":"a858611b044a8302ab14cfe752e17369","login":"openframeworks","avatar_url":"https://secure.gravatar.com/avatar/a858611b044a8302ab14cfe752e17369?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":142866},"name":"openFrameworks","mirror_url":null,"language":"C","description":"OpenFrameworks is a cross platform open source toolkit for creative coding in C++.","ssh_url":"git@github.com:openframeworks/openFrameworks.git","pushed_at":"2012-05-29T19:23:07Z","created_at":"2009-10-21T21:55:54Z","id":345337,"full_name":"openframeworks/openFrameworks"}
File diff suppressed because one or more lines are too long