diff options
author | Tony NIU <niuwl586@gmail.com> | 2013-01-09 20:09:40 +0800 |
---|---|---|
committer | Tony NIU <niuwl586@gmail.com> | 2013-01-15 08:43:28 +0800 |
commit | 9c2c4ece645119fd450783217c359b38584553c8 (patch) | |
tree | b6f13baf986da692864ae621629730cc697e6063 /tests/test_v3_catalog.py | |
parent | 9460ff5c35809f4911cb5a1ee5f68d6351e797f4 (diff) | |
download | keystone-9c2c4ece645119fd450783217c359b38584553c8.tar.gz keystone-9c2c4ece645119fd450783217c359b38584553c8.tar.xz keystone-9c2c4ece645119fd450783217c359b38584553c8.zip |
add database string field length check
Added database string field length check, so when insert to a table, if the length of string field exceed the limit of column when, it will return a 400 error instead of truncating the string.
Change-Id: I7216fe736ea6e5a23b5647b107fcb2699f1fa99d
Fixes: bug #1090247
Diffstat (limited to 'tests/test_v3_catalog.py')
-rw-r--r-- | tests/test_v3_catalog.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_v3_catalog.py b/tests/test_v3_catalog.py index 9f5bf913..3a901709 100644 --- a/tests/test_v3_catalog.py +++ b/tests/test_v3_catalog.py @@ -119,6 +119,15 @@ class CatalogTestCase(test_v3.RestfulTestCase): body={'endpoint': ref}) self.assertValidEndpointResponse(r, ref) + def assertValidErrorResponse(self, response): + self.assertTrue(response.status in [400]) + + def test_create_endpoint_400(self): + """POST /endpoints""" + ref = self.new_endpoint_ref(service_id=self.service_id) + ref["region"] = "0" * 256 + self.post('/endpoints', body={'endpoint': ref}, expected_status=400) + def test_get_endpoint(self): """GET /endpoints/{endpoint_id}""" r = self.get( |