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
13 from functest.opnfv_tests.vnf.ims import clearwater
14 from functest.opnfv_tests.vnf.ims import orchestrator_cloudify
17 class ClearwaterTesting(unittest.TestCase):
19 logging.disable(logging.CRITICAL)
22 self.clearwater = clearwater.Clearwater()
23 self.orchestrator = orchestrator_cloudify.Orchestrator('test_dir')
24 self.clearwater.orchestrator = self.orchestrator
25 self.clearwater.dep_name = 'test_dep_name'
26 self.bp = {'file_name': 'test_file',
27 'destination_folder': 'test_folder',
29 'branch': 'test_branch'}
31 def test_deploy_vnf_blueprint_download_failed(self):
32 with mock.patch.object(self.clearwater.orchestrator,
33 'download_upload_and_deploy_blueprint',
34 return_value='error'):
35 self.assertEqual(self.clearwater.deploy_vnf(self.bp),
38 def test_deploy_vnf_blueprint_download_passed(self):
39 with mock.patch.object(self.clearwater.orchestrator,
40 'download_upload_and_deploy_blueprint',
42 self.clearwater.deploy_vnf(self.bp),
43 self.assertEqual(self.clearwater.deploy, True)
45 def test_undeploy_vnf_deployment_passed(self):
46 with mock.patch.object(self.clearwater.orchestrator,
47 'undeploy_deployment'):
48 self.clearwater.deploy = True
49 self.clearwater.undeploy_vnf(),
50 self.assertEqual(self.clearwater.deploy, False)
53 if __name__ == "__main__":
54 unittest.main(verbosity=2)