summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-06-24 10:40:31 +0000
committerGerrit Code Review <review@openstack.org>2015-06-24 10:40:31 +0000
commite6e6fe912887ea69297adcfc9f0f2f6a7264763c (patch)
tree1454f83268e6c7071e771687e59ae68889a799f4
parent0266c7231a5cce9fce9a6f947719cda4677ad0c3 (diff)
parentcc1cc99f49b63826ee97020c9475f65d1b0d4bfc (diff)
downloaddesignate-1.0.0.0b1.tar.gz
Merge "Fix incorrect status code on Pool update"1.0.0.0b1
-rw-r--r--designate/api/v2/controllers/pools.py2
-rw-r--r--designate/tests/test_api/test_v2/test_pools.py12
-rw-r--r--functionaltests/api/v2/test_pool.py2
3 files changed, 8 insertions, 8 deletions
diff --git a/designate/api/v2/controllers/pools.py b/designate/api/v2/controllers/pools.py
index f7a0d1f1..37e6649c 100644
--- a/designate/api/v2/controllers/pools.py
+++ b/designate/api/v2/controllers/pools.py
@@ -103,7 +103,7 @@ class PoolsController(rest.RestController):
pool = self.central_api.update_pool(context, pool)
- response.status_int = 200
+ response.status_int = 202
return DesignateAdapter.render('API_v2', pool, request=request)
diff --git a/designate/tests/test_api/test_v2/test_pools.py b/designate/tests/test_api/test_v2/test_pools.py
index bcc10cbd..ac8f2b99 100644
--- a/designate/tests/test_api/test_v2/test_pools.py
+++ b/designate/tests/test_api/test_v2/test_pools.py
@@ -176,10 +176,10 @@ class ApiV2PoolsTest(ApiV2TestCase):
body = {'description': 'Tester'}
url = '/pools/%s' % pool['id']
- response = self.client.patch_json(url, body, status=200)
+ response = self.client.patch_json(url, body, status=202)
# Check the headers are what we expect
- self.assertEqual(200, response.status_int)
+ self.assertEqual(202, response.status_int)
self.assertEqual('application/json', response.content_type)
# Check the body structure is what we expect
@@ -217,10 +217,10 @@ class ApiV2PoolsTest(ApiV2TestCase):
]}
url = '/pools/%s' % pool['id']
- response = self.client.patch_json(url, body, status=200)
+ response = self.client.patch_json(url, body, status=202)
# Check the headers are what we expect
- self.assertEqual(200, response.status_int)
+ self.assertEqual(202, response.status_int)
self.assertEqual('application/json', response.content_type)
# Check the body structure is what we expect
@@ -241,10 +241,10 @@ class ApiV2PoolsTest(ApiV2TestCase):
body = {"attributes": {"scope": "private"}}
url = '/pools/%s' % pool['id']
- response = self.client.patch_json(url, body, status=200)
+ response = self.client.patch_json(url, body, status=202)
# Check the headers are what we expect
- self.assertEqual(200, response.status_int)
+ self.assertEqual(202, response.status_int)
self.assertEqual('application/json', response.content_type)
# Check the values returned are what we expect
diff --git a/functionaltests/api/v2/test_pool.py b/functionaltests/api/v2/test_pool.py
index bf5ffd78..6fa38b80 100644
--- a/functionaltests/api/v2/test_pool.py
+++ b/functionaltests/api/v2/test_pool.py
@@ -45,7 +45,7 @@ class PoolTest(DesignateV2Test):
patch_model = datagen.random_pool_data()
resp, new_model = PoolClient.as_user('admin').patch_pool(
old_model.id, patch_model)
- self.assertEqual(resp.status, 200)
+ self.assertEqual(resp.status, 202)
resp, model = PoolClient.as_user('admin').get_pool(new_model.id)
self.assertEqual(resp.status, 200)