Skip to content

Commit

Permalink
Adding public next_page() to Iterator.
Browse files Browse the repository at this point in the history
The previous implementation may catch users off guard since
the iterator.page access may also update the value before
access.

In addition, this PR removed the _update_page() / next_page()
subclass behavior in _BlobIterator. Over-riding that method
was never intended. Instead makes a non-public class attribute
_PAGE_CLASS that can be replaced with Page subclasses. This
can be revisited if more implementations require custom
behavior on Page creation / Page.__init__.
  • Loading branch information
dhermes committed Oct 15, 2016
1 parent ab05218 commit d87b77f
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def dummy_response():
iterator = self._makeOne(client)
iterator._get_next_page_response = dummy_response

iterator.next_page()
page = iterator.page
self.assertEqual(page.num_items, 1)
project = iterator.next()
Expand Down

0 comments on commit d87b77f

Please sign in to comment.