Issue-ID: MULTICLOUD-835
Signed-off-by: Bin Yang <Bin.Yang@windriver.com>
Change-Id: Ib6fa7d2bece2e3160babf1139fd8b73e19a34a9a
import uuid
import httplib2
import base64
import uuid
import httplib2
import base64
from multivimbroker.pub.config.config import AAI_SCHEMA_VERSION
from multivimbroker.pub.config.config import AAI_SERVICE_URL
from multivimbroker.pub.config.config import AAI_SCHEMA_VERSION
from multivimbroker.pub.config.config import AAI_SERVICE_URL
resp, resp_content = http.request(
full_url, method=method.upper(),
body=content, headers=headers)
resp, resp_content = http.request(
full_url, method=method.upper(),
body=content, headers=headers)
- resp_status, resp_body = resp['status'], resp_content
+ resp_status, resp_body = resp['status'], codecs.decode(
+ resp_content, 'UTF-8') if resp_content else None
if resp_status in status_ok_list:
ret = [0, resp_body, resp_status, resp]
if resp_status in status_ok_list:
ret = [0, resp_body, resp_status, resp]
"status": "200"
}
resp_content = "hello"
"status": "200"
}
resp_content = "hello"
- mock_req.return_value = mock_resp, resp_content
+ mock_req.return_value = mock_resp, resp_content.encode("utf-8")
expect_ret = [0, resp_content, "200", mock_resp]
ret = restcall.call_req("http://onap.org/", "user", "pass",
restcall.rest_no_auth, "vim", "GET")
expect_ret = [0, resp_content, "200", mock_resp]
ret = restcall.call_req("http://onap.org/", "user", "pass",
restcall.rest_no_auth, "vim", "GET")