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
13 from functest.core import vnf_base
16 class VnfBaseTesting(unittest.TestCase):
18 logging.disable(logging.CRITICAL)
21 self.test = vnf_base.VnfOnBoardingBase(project='functest',
23 self.test.project = "functest"
24 self.test.case_name = "aaa"
25 self.test.start_time = "1"
26 self.test.stop_time = "5"
27 self.test.criteria = ""
28 self.test.details = {"orchestrator": {"status": "PASS",
31 "vnf": {"status": "PASS",
34 "test_vnf": {"status": "FAIL",
38 def test_deploy_vnf_unimplemented(self):
39 with self.assertRaises(Exception) as context:
40 self.test.deploy_vnf()
41 self.assertTrue('VNF not deployed' in context.exception)
43 def test_test_vnf_unimplemented(self):
44 with self.assertRaises(Exception) as context:
45 self.test.test_vnf()()
46 self.assertTrue('VNF not tested' in context.exception)
48 def test_parse_results(self):
49 self.assertNotEqual(self.test.parse_results(), 0)
52 if __name__ == "__main__":
53 unittest.main(verbosity=2)