Add pagination to v1 image-list
* Use recursive generator function to make subsequent requests to the v1 detailed images resource * 'limit' continues to act as the absolute limit of images to return from a list call * 'page_size' indicates how many images to ask for in each subsequent pagination request * Expose --page-size through the cli * Convert v1 images tests to use strict url comparison * Drop strict_url_check from FakeAPI kwargs - now the functionality is always active and tests must directly match fixture urls * Fix bug 1024614 Change-Id: Ifa7874d88360e03b5c8aa95bfb9d5e6dc6dc927e
This commit is contained in:
+1
-4
@@ -15,16 +15,13 @@
|
||||
|
||||
|
||||
class FakeAPI(object):
|
||||
def __init__(self, fixtures, strict_url_check=False):
|
||||
def __init__(self, fixtures):
|
||||
self.fixtures = fixtures
|
||||
self.calls = []
|
||||
self.strict_url_check = strict_url_check
|
||||
|
||||
def _request(self, method, url, headers=None, body=None):
|
||||
call = (method, url, headers or {}, body)
|
||||
self.calls.append(call)
|
||||
if not self.strict_url_check:
|
||||
url = url.split('?', 1)[0]
|
||||
return self.fixtures[url][method]
|
||||
|
||||
def raw_request(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user