Ensure v1 'limit' query parameter works correctly.
The tests were present but were not asserting list results. page_size was overriding the absolute limit so limits were not working if they were less than the page_size. Fixes bug 1037233 Change-Id: If102824212e3846bc65d3f7928cf7aa2e48aaa63
This commit is contained in:
@@ -223,8 +223,9 @@ class ImageManagerTest(unittest.TestCase):
|
||||
self.assertEqual(images[2].id, 'c')
|
||||
|
||||
def test_list_with_limit_less_than_page_size(self):
|
||||
list(self.mgr.list(page_size=20, limit=10))
|
||||
expect = [('GET', '/v1/images/detail?limit=20', {}, None)]
|
||||
results = list(self.mgr.list(page_size=2, limit=1))
|
||||
expect = [('GET', '/v1/images/detail?limit=2', {}, None)]
|
||||
self.assertEqual(1, len(results))
|
||||
self.assertEqual(self.api.calls, expect)
|
||||
|
||||
def test_list_with_limit_greater_than_page_size(self):
|
||||
|
||||
Reference in New Issue
Block a user