diff options
Diffstat (limited to 'functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py')
-rw-r--r-- | functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py b/functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py index d023d4796..9eb3c5d69 100644 --- a/functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py +++ b/functest/opnfv_tests/vnf/router/test_controller/function_test_exec.py @@ -7,9 +7,12 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 +# pylint: disable=missing-docstring + """vrouter function test execution module""" import logging +import os import time import yaml @@ -18,7 +21,7 @@ from functest.opnfv_tests.vnf.router.vnf_controller.vnf_controller import ( VnfController) -class FunctionTestExec(object): +class FunctionTestExec(): """vrouter function test execution class""" logger = logging.getLogger(__name__) @@ -29,17 +32,16 @@ class FunctionTestExec(object): credentials = util_info["credentials"] self.vnf_ctrl = VnfController(util_info) - test_cmd_map_file = open(self.util.vnf_data_dir + - self.util.opnfv_vnf_data_dir + - self.util.command_template_dir + - self.util.test_cmd_map_yaml_file, - 'r') - self.test_cmd_map_yaml = yaml.safe_load(test_cmd_map_file) - test_cmd_map_file.close() + with open( + os.path.join( + self.util.vnf_data_dir, self.util.command_template_dir, + self.util.test_cmd_map_yaml_file), + 'r', encoding='utf-8') as test_cmd_map_file: + self.test_cmd_map_yaml = yaml.safe_load(test_cmd_map_file) - self.util.set_credentials(credentials["snaps_creds"]) + self.util.set_credentials(credentials["cloud"]) - with open(self.util.test_env_config_yaml) as file_fd: + with open(self.util.test_env_config_yaml, encoding='utf-8') as file_fd: test_env_config_yaml = yaml.safe_load(file_fd) file_fd.close() |