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]))
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)