X-Git-Url: https://gerrit.onap.org/r/gitweb?p=multicloud%2Fframework.git;a=blobdiff_plain;f=multivimbroker%2Fmultivimbroker%2Ftests%2Ftest_restcall.py;h=8ac1948a0d7c3d06ac1652a65ee57fef4a3c95ee;hp=a6870a54477f60a2ec4b893d64954c0a8545acd9;hb=3566b3cb03fd2c6d255a0a3783834154cc5e4484;hpb=884f87fd75c7de89eec65f851cd0615ace865082 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)