terrasnek icon indicating copy to clipboard operation
terrasnek copied to clipboard

logic bug in _list_all

Open evilensky opened this issue 2 years ago • 2 comments

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.

evilensky avatar Nov 21 '22 00:11 evilensky

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?

dahlke avatar Nov 23 '22 01:11 dahlke

Updated comment for clarity and closed pull request.

evilensky avatar Nov 23 '22 14:11 evilensky

Closing this as it's gotten stale and may be approached differently in the future.

dahlke avatar Aug 27 '23 22:08 dahlke