From e5c7e3c01d15f09b3892d353e336cf524539daea Mon Sep 17 00:00:00 2001 From: Derek Chiang Date: Wed, 22 May 2013 05:07:20 +0000 Subject: [PATCH] Added a test for bad limit param Change-Id: Ic9a93779d5623644ccf210de622d59f999571dd2 --- cinder/tests/api/test_common.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cinder/tests/api/test_common.py b/cinder/tests/api/test_common.py index f6bdec94c..1a8eba040 100644 --- a/cinder/tests/api/test_common.py +++ b/cinder/tests/api/test_common.py @@ -98,6 +98,12 @@ class LimiterTest(test.TestCase): self.assertEqual(common.limited(self.medium, req), self.medium) self.assertEqual(common.limited(self.large, req), self.large[:1000]) + def test_limiter_limit_bad(self): + """ Test with a bad limit. """ + req = webob.Request.blank(u'/?limit=hello') + self.assertRaises( + webob.exc.HTTPBadRequest, common.limited, self.tiny, req) + def test_limiter_limit_medium(self): """ Test limit of 10. """ req = webob.Request.blank('/?limit=10') -- 2.45.2