Add test_req_by_msb 47/37947/1
authorEthan Lynn <ethanlynnl@vmware.com>
Fri, 23 Mar 2018 03:12:10 +0000 (11:12 +0800)
committerEthan Lynn <ethanlynnl@vmware.com>
Fri, 23 Mar 2018 03:15:59 +0000 (11:15 +0800)
Add tests test_req_by_msb for restcall.py

Change-Id: Ic50d07a52522d67a6f760b5e332e1c93610a45f6
Issue-ID: MULTICLOUD-198
Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
multivimbroker/multivimbroker/tests/test_restcall.py

index 4ecf04e..235d58a 100644 (file)
@@ -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)