Calcuate totalCount without iterating PaginatedList (#820)

This PR #596 seems stale, so I have opened up this one with the requested changes from @sfdye.

This is the code from @Tommos0's [comment][1] with some modification.

There are 2 tests failing. I think this is due to the change in the query string and the cached test data just needs to be refreshed for those tests.

[1]: https://github.com/PyGithub/PyGithub/pull/596#issuecomment-315013949
This commit is contained in:
Joel Koglin
2018-07-08 10:43:48 +08:00
committed by Wan Liuyang
parent c6802b515f
commit e6eabe9ad0
4 changed files with 23 additions and 7 deletions
-2
View File
@@ -38,8 +38,6 @@ class Search(Framework.TestCase):
def testSearchUsers(self):
users = self.g.search_users("vincent", sort="followers", order="desc")
self.assertEqual(users.totalCount, 2781)
self.assertEqual(users[0].login, "nvie")
self.assertEqual(users[14].login, "Vayn")
def testPaginateSearchUsers(self):
users = self.g.search_users("", location="Berlin")