summaryrefslogtreecommitdiff
path: root/tests/v1
diff options
context:
space:
mode:
authorBrian Lamar <brian.lamar@rackspace.com>2012-08-15 14:39:39 -0400
committerBrian Lamar <brian.lamar@rackspace.com>2012-08-15 14:50:11 -0400
commitd64876424e87b3a7f76a9bf4d29fdacbc5ad4bc4 (patch)
tree18714adff091abc444654bdb9be16a4ce485d0d7 /tests/v1
parenta5b8165d7de5edd15a616e2ff97c1f8b72b53e8c (diff)
downloadpython-glanceclient-0.4.2.tar.gz
Ensure v1 'limit' query parameter works correctly.0.4.2
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
Diffstat (limited to 'tests/v1')
-rw-r--r--tests/v1/test_images.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/v1/test_images.py b/tests/v1/test_images.py
index 6f258e6..759010f 100644
--- a/tests/v1/test_images.py
+++ b/tests/v1/test_images.py
@@ -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):