From: Ethan Lynn Date: Fri, 23 Mar 2018 03:12:10 +0000 (+0800) Subject: Add test_req_by_msb X-Git-Tag: v1.1.2~45^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=multicloud%2Fframework.git;a=commitdiff_plain;h=3b7133a34ea3b55c65c646d92a6e905b62d9e2e5 Add test_req_by_msb Add tests test_req_by_msb for restcall.py Change-Id: Ic50d07a52522d67a6f760b5e332e1c93610a45f6 Issue-ID: MULTICLOUD-198 Signed-off-by: Ethan Lynn --- diff --git a/multivimbroker/multivimbroker/tests/test_restcall.py b/multivimbroker/multivimbroker/tests/test_restcall.py index 4ecf04e..235d58a 100644 --- a/multivimbroker/multivimbroker/tests/test_restcall.py +++ b/multivimbroker/multivimbroker/tests/test_restcall.py @@ -41,3 +41,15 @@ class TestRestCall(unittest.TestCase): mock_call.assert_called_once_with( expect_url, expect_user, expect_pass, restcall.rest_no_auth, res, "GET", content, expect_headers) + + @mock.patch.object(restcall, "call_req") + def test_req_by_msb(self, mock_call): + res = "multicloud" + method = "GET" + content = "no content" + headers = None + restcall.req_by_msb(res, method, content=content, headers=headers) + expect_url = "http://127.0.0.1:10080/" + mock_call.assert_called_once_with( + expect_url, "", "", restcall.rest_no_auth, res, method, + content, headers)