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:
Brian Lamar
2012-08-15 14:39:39 -04:00
parent a5b8165d7d
commit d64876424e
2 changed files with 7 additions and 4 deletions
+3 -2
View File
@@ -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):