terrasnek
terrasnek copied to clipboard
logic bug in _list_all
I think there is a logic bug in the code at
https://github.com/dahlke/terrasnek/blob/e1c4fbe5f707ce4f028c0e73b8d53e6fc3f09a89/terrasnek/endpoint.py#L366-L387
current_page = 1
continues to be true during the while loop and ends up being retrieved twice before being incremented to page 2.
Source: setting up mocks for the workspaces.list_all()
and the mock was called 3 times for 2 pages.
I don't want us to use PyTest at this time, so I'm not sure if this is required considering we won't be using StopIteration?
Updated comment for clarity and closed pull request.
Closing this as it's gotten stale and may be approached differently in the future.