diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2017-10-11 13:44:47 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2017-11-15 08:51:41 +0100 |
commit | 14d96c8b08ca40218476168f45d78cd7e6c8c276 (patch) | |
tree | 46dcb0064f8d85427b5401ffe49bf10f52baa9df | |
parent | 61083f97ca4552ffa4fa83b20d30f4a914e24eee (diff) |
Update unit test related to vyos_vrouter
Utilvnf is now mocked to stop triggering the git clone of an
external repo and creating dirs.
Else we may get errors when testing offline.
Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com>
Change-Id: Ia7e86593ecca9b9add747ef89b1d5e8d6bdb2d7c
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r-- | functest/tests/unit/vnf/router/test_cloudify_vrouter.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/functest/tests/unit/vnf/router/test_cloudify_vrouter.py b/functest/tests/unit/vnf/router/test_cloudify_vrouter.py index 4f256234b..4d8e9405b 100644 --- a/functest/tests/unit/vnf/router/test_cloudify_vrouter.py +++ b/functest/tests/unit/vnf/router/test_cloudify_vrouter.py @@ -18,7 +18,11 @@ from functest.opnfv_tests.vnf.router import cloudify_vrouter class CloudifyVrouterTesting(unittest.TestCase): - def setUp(self): + @mock.patch('functest.opnfv_tests.vnf.router.cloudify_vrouter.Utilvnf') + @mock.patch('functest.opnfv_tests.vnf.router.cloudify_vrouter.vrouter_base' + '.Utilvnf') + @mock.patch('os.makedirs') + def setUp(self, *args): self.tenant = 'cloudify_vrouter' self.creds = {'username': 'user', @@ -41,14 +45,12 @@ class CloudifyVrouterTesting(unittest.TestCase): 'ram_min': 2048}}}} with mock.patch('functest.opnfv_tests.vnf.router.cloudify_vrouter.' - 'os.makedirs'), \ - mock.patch('functest.opnfv_tests.vnf.router.cloudify_vrouter.' - 'get_config', return_value={ - 'tenant_images': 'foo', - 'orchestrator': self.orchestrator, - 'vnf': self.vnf, - 'vnf_test_suite': '', - 'version': 'whatever'}): + 'get_config', return_value={ + 'tenant_images': 'foo', + 'orchestrator': self.orchestrator, + 'vnf': self.vnf, + 'vnf_test_suite': '', + 'version': 'whatever'}): self.router_vnf = cloudify_vrouter.CloudifyVrouter() |