bugfix: using custom per_page in repo.get_comments

This commit is contained in:
davidbrai
2013-06-19 00:36:03 +03:00
parent d0002b7a3c
commit 8d22935180
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ class PaginatedList(PaginatedListBase):
self.__firstUrl = firstUrl
self.__firstParams = firstParams or ()
self.__nextUrl = firstUrl
self.__nextParams = firstParams
self.__nextParams = firstParams or {}
if self.__requester.per_page != 30:
self.__nextParams["per_page"] = self.__requester.per_page
+11 -1
View File
@@ -15,7 +15,8 @@
# 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
import CommitComment
from github.PaginatedList import PaginatedList as PaginatedListImpl
class PaginatedList(Framework.TestCase):
def setUp(self):
@@ -88,6 +89,15 @@ class PaginatedList(Framework.TestCase):
self.g.per_page = 100
self.assertEqual(self.g.per_page, 100)
self.assertEqual(len(list(self.repo.get_issues())), 456)
def testCustomPerPageWithNoUrlParams(self):
self.g.per_page = 100
paginated_list = PaginatedListImpl(
CommitComment.CommitComment,
self.repo._requester,
self.repo.url + "/comments",
None
)
def testCustomPerPageWithGetPage(self):
self.g.per_page = 100