aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/core/test_vnf.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-05-09 09:50:02 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-05-09 09:50:02 +0200
commitb9cac1d63b0c919c961671a1405cbb3ced06942b (patch)
treee9b88fb2de0ea44b8b78f14f4c888b080e11c6a2 /functest/tests/unit/core/test_vnf.py
parent1d5e199517ff09d959a1240f3b4e715be799058b (diff)
Rename vnf_base to vnf
Change-Id: I0b8b9b2e85717fc92a233e4f7344b3419421778d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/core/test_vnf.py')
-rw-r--r--functest/tests/unit/core/test_vnf.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/functest/tests/unit/core/test_vnf.py b/functest/tests/unit/core/test_vnf.py
new file mode 100644
index 000000000..a0e733084
--- /dev/null
+++ b/functest/tests/unit/core/test_vnf.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2016 Orange and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+
+import logging
+import unittest
+
+from functest.core import vnf
+
+
+class VnfBaseTesting(unittest.TestCase):
+
+ logging.disable(logging.CRITICAL)
+
+ def setUp(self):
+ self.test = vnf.VnfOnBoardingBase(project='functest',
+ case_name='aaa')
+ self.test.project = "functest"
+ self.test.start_time = "1"
+ self.test.stop_time = "5"
+ self.test.result = ""
+ self.test.details = {"orchestrator": {"status": "PASS",
+ "result": "",
+ "duration": 20},
+ "vnf": {"status": "PASS",
+ "result": "",
+ "duration": 15},
+ "test_vnf": {"status": "FAIL",
+ "result": "",
+ "duration": 5}}
+
+ def test_deploy_vnf_unimplemented(self):
+ with self.assertRaises(Exception) as context:
+ self.test.deploy_vnf()
+ self.assertTrue('VNF not deployed' in context.exception)
+
+ def test_test_vnf_unimplemented(self):
+ with self.assertRaises(Exception) as context:
+ self.test.test_vnf()()
+ self.assertTrue('VNF not tested' in context.exception)
+
+ def test_parse_results(self):
+ self.assertNotEqual(self.test.parse_results(), 0)
+
+
+if __name__ == "__main__":
+ unittest.main(verbosity=2)