Add code coverage for multicloud framework
[multicloud/framework.git] / multivimbroker / multivimbroker / tests / test_urls.py
1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at:
4 #       http://www.apache.org/licenses/LICENSE-2.0
5 #
6 # Unless required by applicable law or agreed to in writing, software
7 # distributed under the License is distributed on an "AS IS" BASIS,
8 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
10 import json
11 import mock
12 import unittest
13
14 from multivimbroker.pub.config import config
15 from multivimbroker import urls
16
17
18 class TestUrls(unittest.TestCase):
19
20     def test_request_msb(self):
21         with mock.patch("multivimbroker.pub.utils.restcall."
22                         "req_by_msb") as req_by_msb:
23             urls.req_msb(True)
24             req_by_msb.assert_called_once_with(
25                config.REG_TO_MSB_REG_URL, "POST",
26                json.JSONEncoder().encode(config.REG_TO_MSB_REG_PARAM))