summaryrefslogtreecommitdiffstats
path: root/multivimbroker
diff options
context:
space:
mode:
Diffstat (limited to 'multivimbroker')
-rw-r--r--multivimbroker/multivimbroker/tests/test_restcall.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/multivimbroker/multivimbroker/tests/test_restcall.py b/multivimbroker/multivimbroker/tests/test_restcall.py
index 235d58a..8ac1948 100644
--- a/multivimbroker/multivimbroker/tests/test_restcall.py
+++ b/multivimbroker/multivimbroker/tests/test_restcall.py
@@ -18,8 +18,8 @@ class TestRestCall(unittest.TestCase):
def test_combine_url(self):
url = ["http://a.com/test/", "http://a.com/test/",
- "http://a.com/test"]
- res = ["/resource", "resource", "/resource"]
+ "http://a.com/test", "http://a.com/test"]
+ res = ["/resource", "resource", "/resource", "resource"]
expected = "http://a.com/test/resource"
for i in range(len(url)):
self.assertEqual(expected, restcall.combine_url(url[i], res[i]))
@@ -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)