diff options
author | Ethan Lynn <ethanlynnl@vmware.com> | 2018-03-27 07:34:16 -0700 |
---|---|---|
committer | Ethan Lynn <ethanlynnl@vmware.com> | 2018-03-27 07:34:16 -0700 |
commit | 71a9a92ab5116f76ad0aed69528f401d292f591a (patch) | |
tree | fd8067d1e83173ceadff2e7192ab302069da2087 | |
parent | e53a085d62d69d70a4a596b1db5bc229828f55aa (diff) |
Add test_call_req_success
Add test_call_req_success
Change-Id: I59ff0f66ff59a3982473b13e4da18116b978e4eb
Issue-ID: MULTICLOUD-199
Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
-rw-r--r-- | vio/vio/tests/test_restcall.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vio/vio/tests/test_restcall.py b/vio/vio/tests/test_restcall.py index 83fc04e..051dddf 100644 --- a/vio/vio/tests/test_restcall.py +++ b/vio/vio/tests/test_restcall.py @@ -52,3 +52,15 @@ class TestRestCall(unittest.TestCase): mock_call.assert_called_once_with( expect_url, "", "", restcall.rest_no_auth, res, method, content) + + @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) |