summaryrefslogtreecommitdiffstats
path: root/multivimbroker
diff options
context:
space:
mode:
authorLiang Ke <lokyse@163.com>2018-03-26 08:57:48 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-26 08:57:48 +0000
commit3566b3cb03fd2c6d255a0a3783834154cc5e4484 (patch)
treec1a05fdae5a15e4c5e2b8e7f8e34384581919987 /multivimbroker
parent884f87fd75c7de89eec65f851cd0615ace865082 (diff)
parent0e1f816f012a92b6e2283bb300fbe1b054138941 (diff)
Merge "Add test_call_req_success"
Diffstat (limited to 'multivimbroker')
-rw-r--r--multivimbroker/multivimbroker/tests/test_restcall.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/multivimbroker/multivimbroker/tests/test_restcall.py b/multivimbroker/multivimbroker/tests/test_restcall.py
index a6870a5..8ac1948 100644
--- a/multivimbroker/multivimbroker/tests/test_restcall.py
+++ b/multivimbroker/multivimbroker/tests/test_restcall.py
@@ -53,3 +53,15 @@ class TestRestCall(unittest.TestCase):
mock_call.assert_called_once_with(
expect_url, "", "", restcall.rest_no_auth, res, method,
content, headers)
+
+ @mock.patch("httplib2.Http.request")
+ def test_call_req_success(self, mock_req):
+ mock_resp = {
+ "status": "200"
+ }
+ resp_content = "hello"
+ mock_req.return_value = mock_resp, resp_content
+ expect_ret = [0, resp_content, "200", mock_resp]
+ ret = restcall.call_req("http://onap.org/", "user", "pass",
+ restcall.rest_no_auth, "vim", "GET")
+ self.assertEqual(expect_ret, ret)