From 3b7133a34ea3b55c65c646d92a6e905b62d9e2e5 Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Fri, 23 Mar 2018 11:12:10 +0800 Subject: [PATCH] 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 --- multivimbroker/multivimbroker/tests/test_restcall.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) -- 2.16.6