summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-02-09 00:02:56 +0000
committerGerrit Code Review <review@openstack.org>2013-02-09 00:02:56 +0000
commitb561e8a981cdb7e2103ec91d0c6f95de90faadcf (patch)
treec68651fe757d59853578154c9865f75183dc24eb /tests
parentb67afa9d61ec968145699eaee4a162ad25e1a587 (diff)
parent5342209a3dc0bf4e41cab87b894954526edcbffd (diff)
downloadkeystone-b561e8a981cdb7e2103ec91d0c6f95de90faadcf.tar.gz
keystone-b561e8a981cdb7e2103ec91d0c6f95de90faadcf.tar.xz
keystone-b561e8a981cdb7e2103ec91d0c6f95de90faadcf.zip
Merge "return 400 Bad Request if invalid params supplied (bug1061738)"
Diffstat (limited to 'tests')
-rw-r--r--tests/test_content_types.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_content_types.py b/tests/test_content_types.py
index 6b0a03e0..20bf3386 100644
--- a/tests/test_content_types.py
+++ b/tests/test_content_types.py
@@ -506,6 +506,27 @@ class CoreApiTests(object):
"""This triggers assertValidErrorResponse by convention."""
self.public_request(path='/v2.0/tenants', expected_status=401)
+ def test_invalid_parameter_error_response(self):
+ token = self.get_scoped_token()
+ bad_body = {
+ 'OS-KSADM:serviceBAD': {
+ 'name': uuid.uuid4().hex,
+ 'type': uuid.uuid4().hex,
+ },
+ }
+ res = self.admin_request(method='POST',
+ path='/v2.0/OS-KSADM/services',
+ body=bad_body,
+ token=token,
+ expected_status=400)
+ self.assertValidErrorResponse(res)
+ res = self.admin_request(method='POST',
+ path='/v2.0/users',
+ body=bad_body,
+ token=token,
+ expected_status=400)
+ self.assertValidErrorResponse(res)
+
class JsonTestCase(RestfulTestCase, CoreApiTests):
content_type = 'json'