summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYun Huang <yun.huang@windriver.com>2018-03-28 14:03:45 +0800
committerYun Huang <yun.huang@windriver.com>2018-03-28 14:03:45 +0800
commitbfeb9185defd85249f195821af76360d706f8644 (patch)
tree3f61de82779fccbe5e01e466cc5e9988bfcb12f6
parente38d564a2d382b6d338ef119b80d54a1ebd9447c (diff)
Fix ocata registration UT bug
Change-Id: I65ba771e013615464e7c0bbce3bf19d694d33bef Issue-ID: MULTICLOUD-200 Signed-off-by: Yun Huang <yun.huang@windriver.com>
-rw-r--r--ocata/ocata/registration/tests/test_registration.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/ocata/ocata/registration/tests/test_registration.py b/ocata/ocata/registration/tests/test_registration.py
index f4770254..15e46cff 100644
--- a/ocata/ocata/registration/tests/test_registration.py
+++ b/ocata/ocata/registration/tests/test_registration.py
@@ -13,6 +13,7 @@
# limitations under the License.
import mock
+import json
from rest_framework import status
@@ -221,9 +222,10 @@ class TestFlavors(test_base.TestRequest):
]
})
- response = self.client.post((
- "/api/multicloud-ocata/v0/windriver-hudson-dc_RegionOne/"
- "registry"), TEST_REGISTER_ENDPOINT_REQUEST,
+ response = self.client.post(
+ "/api/multicloud-ocata/v0/windriver-hudson-dc_RegionOne/registry",
+ data=json.dumps(TEST_REGISTER_ENDPOINT_REQUEST),
+ content_type="application/json",
HTTP_X_AUTH_TOKEN=mock_info.MOCK_TOKEN_ID)
self.assertEquals(status.HTTP_202_ACCEPTED,
@@ -234,9 +236,8 @@ class TestFlavors(test_base.TestRequest):
self, mock_delete_vim_info):
mock_delete_vim_info.return_value = 0
- response = self.client.delete((
- "/api/multicloud-ocata/v0/windriver-hudson-dc_RegionOne/"
- "registry"), "{}", content_type="application/json",
+ response = self.client.delete(
+ "/api/multicloud-ocata/v0/windriver-hudson-dc_RegionOne/registry", {}, content_type="application/json",
HTTP_X_AUTH_TOKEN=mock_info.MOCK_TOKEN_ID)
self.assertEquals(status.HTTP_202_ACCEPTED,
@@ -248,9 +249,8 @@ class TestFlavors(test_base.TestRequest):
self, mock_delete_vim_info):
mock_delete_vim_info.return_value = 1
- response = self.client.delete((
- "/api/multicloud-ocata/v0/windriver-hudson-dc_RegionOne/"
- "registry"), "{}", content_type="application/json",
+ response = self.client.delete(
+ "/api/multicloud-ocata/v0/windriver-hudson-dc_RegionOne/registry", {}, content_type="application/json",
HTTP_X_AUTH_TOKEN=mock_info.MOCK_TOKEN_ID)
self.assertEquals(status.HTTP_500_INTERNAL_SERVER_ERROR,