diff options
author | Jamie Lennox <jlennox@redhat.com> | 2013-05-14 10:43:42 +1000 |
---|---|---|
committer | Jamie Lennox <jlennox@redhat.com> | 2013-05-22 09:18:26 +1000 |
commit | 09a5c436c5596dd7e767b1c1c89279b8b697eec1 (patch) | |
tree | e07e13854d63938b18238b63abf045de08297934 /tests/test_v3_catalog.py | |
parent | fe57d6de5b82a8b2ae07bfb136a7b17183c04cbb (diff) | |
download | keystone-09a5c436c5596dd7e767b1c1c89279b8b697eec1.tar.gz keystone-09a5c436c5596dd7e767b1c1c89279b8b697eec1.tar.xz keystone-09a5c436c5596dd7e767b1c1c89279b8b697eec1.zip |
Use webtest for v2 and v3 API testing.
The intention is to remain as close as possible to the original
implementation and so leaves a number of easy cleanups and optimisations
until a later patch.
In writing tests their are a number of changes for API tests that are a
result of webob/webtest restrictions:
* response.body is now the string body and response.result is the parsed
dictionary.
* response.status is now a string eg. '200 OK', use
response.status_code to get the integer
* response.getheader no longer exists. response.headers is a dictionary
like object that can be accessed (case independently) with [] or
.get()
Working towards: blueprint extract-eventlet
Change-Id: I393b4bad2fd6eacc0b8ae98fc204d1323014b5e4
Diffstat (limited to 'tests/test_v3_catalog.py')
-rw-r--r-- | tests/test_v3_catalog.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_v3_catalog.py b/tests/test_v3_catalog.py index e81308fc..91e20454 100644 --- a/tests/test_v3_catalog.py +++ b/tests/test_v3_catalog.py @@ -84,7 +84,7 @@ class CatalogTestCase(test_v3.RestfulTestCase): self.assertValidEndpointResponse(r, ref) def assertValidErrorResponse(self, response): - self.assertTrue(response.status in [400]) + self.assertTrue(response.status_code in [400]) def test_create_endpoint_400(self): """POST /endpoints""" @@ -135,7 +135,7 @@ class CatalogTestCase(test_v3.RestfulTestCase): path='/v2.0/endpoints', token=self.get_scoped_token(), body={'endpoint': ref}) - endpoint_v2 = r.body['endpoint'] + endpoint_v2 = r.result['endpoint'] # test the endpoint on v3 r = self.get('/endpoints') |