Code Review
/
multicloud
/
framework.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
(from parent 1:
884f87f
)
Merge "Add test_call_req_success"
author
Liang Ke
<lokyse@163.com>
Mon, 26 Mar 2018 08:57:48 +0000
(08:57 +0000)
committer
Gerrit Code Review
<gerrit@onap.org>
Mon, 26 Mar 2018 08:57:48 +0000
(08:57 +0000)
multivimbroker/multivimbroker/tests/test_restcall.py
patch
|
blob
|
history
diff --git
a/multivimbroker/multivimbroker/tests/test_restcall.py
b/multivimbroker/multivimbroker/tests/test_restcall.py
index
a6870a5
..
8ac1948
100644
(file)
--- 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)