aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-05-24 17:00:49 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2017-06-06 14:02:11 +0200
commit58667cba215c2cb999d6bcaf891980bda4325b42 (patch)
tree43daaa0fac17d5a8e283126c9fe7d68d523f62c5 /functest/opnfv_tests/vnf/ims/clearwater_ims_base.py
parentd1fe9ae1d51537c73f3264cb1e01342888f5fd3f (diff)
Refactor core VNF class
- Simplify processing - Implement run method to inherit testcase methods - Add unit tests - Fix all pylint issues It also obliges vnf and its uts to be rated 10/10 by pylint. JIRA: FUNCTEST-830 Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: I8dd24eea55089277c9e5b2b51fb14dc377f2fcaf Signed-off-by: Morgan Richomme <morgan.richomme@orange.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/vnf/ims/clearwater_ims_base.py')
-rw-r--r--functest/opnfv_tests/vnf/ims/clearwater_ims_base.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py b/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py
index 42d31e3b..a645dfb2 100644
--- a/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py
+++ b/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py
@@ -17,16 +17,24 @@ import functest.core.vnf as vnf
from functest.utils.constants import CONST
import functest.utils.functest_utils as ft_utils
+__author__ = ("Valentin Boucher <valentin.boucher@orange.com>, "
+ "Helen Yao <helanyao@gmail.com>")
+
class ClearwaterOnBoardingBase(vnf.VnfOnBoarding):
+ """ vIMS clearwater base usable by several orchestrators"""
def __init__(self, **kwargs):
self.logger = logging.getLogger(__name__)
super(ClearwaterOnBoardingBase, self).__init__(**kwargs)
- self.case_dir = os.path.join(CONST.dir_functest_test, 'vnf', 'ims')
- self.data_dir = CONST.dir_ims_data
- self.result_dir = os.path.join(CONST.dir_results, self.case_name)
- self.test_dir = CONST.dir_repo_vims_test
+ self.case_dir = os.path.join(
+ CONST.__getattribute__('dir_functest_test'),
+ 'vnf',
+ 'ims')
+ self.data_dir = CONST.__getattribute__('dir_ims_data')
+ self.result_dir = os.path.join(CONST.__getattribute__('dir_results'),
+ self.case_name)
+ self.test_dir = CONST.__getattribute__('dir_repo_vims_test')
if not os.path.exists(self.data_dir):
os.makedirs(self.data_dir)
@@ -58,7 +66,7 @@ class ClearwaterOnBoardingBase(vnf.VnfOnBoarding):
if rq.status_code != 201:
raise Exception('Failed to get cookie for Ellis')
cookies = rq.cookies
- self.logger.info('Cookies: %s' % cookies)
+ self.logger.info('Cookies: %s', cookies)
number_url = 'http://{0}/accounts/{1}/numbers'.format(
ellis_ip,