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