summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2018-03-25 22:53:09 -0700
committerEthan Lynn <ethanlynnl@vmware.com>2018-03-25 22:53:43 -0700
commit0e1f816f012a92b6e2283bb300fbe1b054138941 (patch)
tree0b248a61c285aef27b79a5c4784f823e62b708ec
parentacffd04f08606b905a63d91ba4f3ae3bb340b1da (diff)
Add test_call_req_success
Add test_call_req_success for restcall.py Change-Id: Ie09e8b0fb8bf88e9123af261a367d2efdafc17bf Issue-ID: MULTICLOUD-198 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
-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 235d58a..2052208 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)