3 # Copyright (c) 2016 Orange and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
14 from functest.core import vnf_base
15 from functest.core import testcase_base
18 class VnfBaseTesting(unittest.TestCase):
20 logging.disable(logging.CRITICAL)
23 self.test = vnf_base.VnfOnBoardingBase(project='functest',
25 self.test.project = "functest"
26 self.test.case_name = "aaa"
27 self.test.start_time = "1"
28 self.test.stop_time = "5"
29 self.test.criteria = ""
30 self.test.details = {"orchestrator": {"status": "PASS",
33 "vnf": {"status": "PASS",
36 "test_vnf": {"status": "FAIL",
40 @mock.patch('logging.Logger.error')
41 def test_deploy_vnf_unimplemented(self, mock):
42 self.assertEqual(self.test.deploy_vnf(),
43 testcase_base.TestcaseBase.EX_TESTCASE_FAILED)
44 mock.assert_called_with('VNF must be deployed')
46 @mock.patch('logging.Logger.error')
47 def test_test_vnf_unimplemented(self, mock):
48 self.assertEqual(self.test.test_vnf(),
49 testcase_base.TestcaseBase.EX_TESTCASE_FAILED)
50 mock.assert_called_with('VNF must be tested')
52 def test_parse_results(self):
53 self.assertNotEqual(self.test.parse_results(), 0)
56 if __name__ == "__main__":
57 unittest.main(verbosity=2)