Avoid running local dnsmasq when testing IMS
[functest.git] / functest / tests / unit / vnf / ims / test_clearwater.py
1 #!/usr/bin/env python
2
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7
8 # pylint: disable=missing-docstring
9
10 import logging
11 import unittest
12
13 import mock
14
15 from functest.opnfv_tests.vnf.ims import clearwater
16
17
18 class ClearwaterTesting(unittest.TestCase):
19
20     def setUp(self):
21         with mock.patch('functest.opnfv_tests.vnf.ims.cloudify_ims.'
22                         'os.makedirs'):
23             self.ims_vnf = clearwater.ClearwaterTesting(
24                 "foo", "0.0.0.0", "0.0.0.0")
25
26         self.mock_post = mock.Mock()
27         attrs = {'status_code': 201,
28                  'cookies': ""}
29         self.mock_post.configure_mock(**attrs)
30
31         self.mock_post_200 = mock.Mock()
32         attrs = {'status_code': 200,
33                  'cookies': ""}
34         self.mock_post_200.configure_mock(**attrs)
35
36         self.mock_post_500 = mock.Mock()
37         attrs = {'status_code': 500,
38                  'cookies': ""}
39         self.mock_post_200.configure_mock(**attrs)
40
41 if __name__ == "__main__":
42     logging.disable(logging.CRITICAL)
43     unittest.main(verbosity=2)